Does anybody know how to issue a shutdown command via code in Windows XP? The old way (like in the VB-World demo) does not work.
Thanks in advance.
Printable View
Does anybody know how to issue a shutdown command via code in Windows XP? The old way (like in the VB-World demo) does not work.
Thanks in advance.
I'm not sure what the demo uses, but XP is an NT based system so you will have to adjust tokens in order to shutdown. It's not very difficult. You can see the whole code here:
http://vbaccelerator.com/tips/vba0019.htm
There is an excelent article about this at msdn.microsoft.com its exactly the same as windows 98 but with an extra parameter
I found it for you:
msdn.microsoft.com/library/en-us/sysinfo/shutdown_3ago.asp?frame=true
I am pretty shure that the link psycho posted is far two much code i accomplished it in less than 30 lines of code
Fozzy, have you tested the code you posted on an XP machine without admin rights?
Errrm... errrrr how can i say this...
...No