Question:
Restarting computer using a .vbs file?
anonymous
2007-01-30 11:19:13 UTC
Here is my code...
---------------------------------------------------------------------
Option Explicit
Set ws = WScript.CreateObject("WScript.Shell")
dim ws , title, Main, n, cn
main = "HKEY_CURRENT_USER\Control Panel\Desktop"
title = "Change Menu Delay Utility"
cn = inputbox("Input a integer for 1-999 and click OK", title )
if not (cn="") then
we.regwrite main & "MenuShowDelay", cn
end if
Dim mybox
if mybox = msgbox("A system restart is required before the changes can be made, continue?.", _
vbyesno, title) = 6 then
...
------------------------------------------------------

And that is where I get lost...How do restart the computer?
I think it has something to do with

%windir%\System32\shutdown.exe -r

but I dont know how to execute that command...help

P.S I am saving the file as .vbs
Three answers:
Kryzchek
2007-01-30 11:24:59 UTC
Create a Shell object and execute the Run method.



Set WshShell = WScript.CreateObject( "WScript.Shell" )

WshShell.Run ( "%windir%\System32\shutdown.exe -r" )





http://www.ss64.com/wsh/run.html
?
2016-11-23 19:21:17 UTC
I had the same virus as quickly as, which alterations my historic past on each and every start to a picture asserting "you have a virulent disease and you greater valuable have an anti-virus or any virus removing. I have been given rid of it by using installation 30 day trial Kaspersky anti-virus 2008 and updating that's database.
ishan j
2007-01-30 11:29:26 UTC
go www.vbcode.com


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...