Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Small problem

Status
Not open for further replies.

Mijjoiji

IS-IT--Management
May 15, 2001
48
SE
Hi!
I´m new to this scripting f***ing s**t...;). Just kidding, I want to make a script that reboots my computer if I click yes on a msgbox. So faar the script looks like this:

Option Explicit

Dim MyVar

MyVar = MsgBox ("... is now installed on your computer, the machine has to be rebooted", vbYesNo, "Reboot")

If vbYes Then

What now? Can´t figure out what to put there...If someone knows about some good reference sites that would be great too...

Best Regards

/Jim
 
1) You can use the Rundll32 utility to execute the ExitWindowsEx Win32API function.
2) You can use WMI, but it's only part of Win2K by default.

3) You can use the Windows Shell, but this only begins the shutdown process as if the user goes to Start>Shut Down.

4) You can use ADSI. Search the MSDN for Shutdown and ADS for an example.
Jon Hawkins
 
jimpain,

You would have to run the command "SHUTDOWN.EXE from the shell passing the correct parameters. I'm not familiar with those but you might check out Microsoft.

fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top