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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 08/11/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity