I have this .vbs script :
...
'***************************************************************************************
Sub Ask4Reboot()
Question = MsgBox("Hostname " & DblQuote(strNewName) & " changed after RR" & vbCrLf &_
"Yes - Restart" & vbCrLF &_
"No - STOP Restart" & vbtab & "",VbYesNo+VbQuestion,Title)
If Question = VbYes then
Reboot()
Else
wscript.Quit(1)
End If
End Sub
'**************************************
Function DblQuote(Str)
DblQuote = chr(34) & Str & chr(34)
End function
'**************************************
Sub Reboot()
Dim ws,Command,Result
Set ws = CreateObject("Wscript.Shell")
Command = "C:\BB\Off.exe "& DblQuote("Restart PC")
Result = ws.run(Command,0,True)
End Sub
'**************************************
How can I change 'Command = shutdown.exe' with C:\BB\Off.exe ; With shutdown.exe command scripts works very well but if I change with Off.exe nothing happend..
edit: *Off.exe works if I just run from cmd.
Thank you.