[TUT] How to make your program shutdown, restart, or log off user [TUT]

Posts 1–7 of 7 · Page 1 of 1
[TUT] How to make your program shutdown, restart, or log off user [TUT]
To shutdown your computer :

Code:
System.Diagnostics.Process.Start("shutdown.exe", "-s -t 0")
to restart:

Code:
system.Diagnostics.Process.Start("shutdown.exe", "-r -t 0")
to log off:

Code:
System.Diagnostics.Process.Start("shutdown.exe", "-l -t 0")
to change how man seconds until it execute the command, change the 0 at the end of the code to whatever amount of seconds you would like. 0 means it will shutdown immediately. 1 will make it shutdown in 1 second, and so on.
you could just use Shell
like
Shell("shutdown -s -t 100")
Quote Originally Posted by stevethehacker View Post
you could just use Shell
like
Shell("shutdown -s -t 100")
same thing... lol

and you can start any other process this

say you wanted to open combat arms,

System.Diagnostics.Process.Start("C:\Nexon\Combat Arms\CombatArms.exe")
Quote Originally Posted by XGelite View Post
same thing... lol

and you can start any other process this

say you wanted to open combat arms,

System.Diagnostics.Process.Start("C:\Nexon\Combat Arms\CombatArms.exe")
you would have to open engine.exe
and either works for the shutdown commands but shell can't start other new processes
The thing at the end: (The red text)
Code:
("shutdown.exe", "-s -t 0")
can control how long it will wait.

change it to this:
Code:
("shutdown.exe", "-s -t 60")
And it will restart in 60 seconds.

To prevent this:
Start > Run... > type in:
Code:
shutdown -a
thanks! this helps out noob slike me at VB
nice i guess ill use this maybe
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?