/build/static/layout/Breadcrumb_cap_w.png

Shell cmd in 64 bit

Hi friends, I want to pass shutdown command from my VB6 application. I am useing shell for it, my code is;

shell("cmd.exe /c shutdown.exe -f -r -t 0",vb.hide)

This works fine on XP,vista 32 bit OS but doesnt work at all on 64 bit versions.

How should make it work on 64 bit OS?

0 Comments   [ + ] Show comments

Answers (1)

Posted by: anonymous_9363 14 years ago
Red Belt
0
How should make it work on 64 bit OS?- Doing it that way even in 32-bit is just plain wrong. You should use the API. If you don't know how, go back to scripting.
- Surely VB6 apps run as 32-bit apps? I doubt you'd be able to access the 64-bit APIs from VB6 anyway.
- Get hold of VS Express Edition and convert your project to VB.Net. AFAICR, it has native classes for handling system stuff like shutdowns.
- IMO, apps have no business restarting the system. Tell the user that a shutdown needs to happen and disable your app until it's happened. There are a very limited set of circumstances which actually require a restart. Thus, if it's your app which requires the restart, it probably needs re-writing anyway.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ