Auto Reboot



shlugi
07-10-2005, 12:56 AM
Does anyone know how to cause Windows XP to reboot with a VBS script? I am
working on this project, we want to be able to use a script that will cause
the machine to reboot and then when it is booting up the machine will run a
defrag. Or also is their a way you can lock the functions of the keyboard and
mouse while a cmd prompt window is open. That way you can run the defrag
through the cmd window and the user can not do anything until the window is
exited because the keyboard is not working. Any help anyone can offer I would
appreciate it. Thanks in advance
TJ Schlouski

Richard Urban
07-10-2005, 12:56 AM
Open a command prompt. Type in shutdown /?

Can you use any of this?

--
Regards,

Richard Urban

aka Crusty (-: Old B@stard :-)

If you knew as much as you think you know,
You would realize that you don't know what you thought you knew!


"shlugi" <shlugi@discussions.microsoft.com> wrote in message
news:706772D1-350E-4274-ABF3-632AAD20EAB3@microsoft.com...
> Does anyone know how to cause Windows XP to reboot with a VBS script? I am
> working on this project, we want to be able to use a script that will
> cause
> the machine to reboot and then when it is booting up the machine will run
> a
> defrag. Or also is their a way you can lock the functions of the keyboard
> and
> mouse while a cmd prompt window is open. That way you can run the defrag
> through the cmd window and the user can not do anything until the window
> is
> exited because the keyboard is not working. Any help anyone can offer I
> would
> appreciate it. Thanks in advance
> TJ Schlouski

Jon
07-10-2005, 12:56 AM
For the reboot, you could use

Set WshShell = WScript.CreateObject("WScript.Shell")
wshshell.run "%comspec% /c" & """shutdown -r -t 1"""

For the cmd window, you could make it invisible, or start it minimized using
wshshell.run
Look at the parameters for the run method in the WSH documentation

http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en

Jon



"shlugi" <shlugi@discussions.microsoft.com> wrote in message
news:706772D1-350E-4274-ABF3-632AAD20EAB3@microsoft.com...
> Does anyone know how to cause Windows XP to reboot with a VBS script? I am
> working on this project, we want to be able to use a script that will
> cause
> the machine to reboot and then when it is booting up the machine will run
> a
> defrag. Or also is their a way you can lock the functions of the keyboard
> and
> mouse while a cmd prompt window is open. That way you can run the defrag
> through the cmd window and the user can not do anything until the window
> is
> exited because the keyboard is not working. Any help anyone can offer I
> would
> appreciate it. Thanks in advance
> TJ Schlouski


Auto Reboot