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?
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)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
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.
so that the conversation will remain readable.