Mainframeguy
Debiant by way of Ubuntu
- Joined
- 29 Aug 2002
- Messages
- 3,763
Maybe I am being too lazy to find out (I do code, just not in VB!)
But is the following a valid script to shutdown windoze XP (I have delimited with <start> and <end> - rest is pasted right out of file)...
<start>
'Begin shell script code'
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\windows\system32\cmd.exe"
'Wait until cmd.exe has loaded'
While WshShell.AppActivate("c:\windows\system32\cmd.exe") = FALSE
wscript.sleep 1000
Wend
'Bring cmd.exe to the foreground'
WshShell.AppActivate "c:\windows\system32\cmd.exe"
'Change directories and issue shutdown command
WshShell.SendKeys "cd{\}"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "cd windows{\}system32"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "shutdown -s"
WshShell.SendKeys "{ENTER}"
'End shell script code'
<end>
incase you wonder why... I am trying to run this when MBM jits a temperature trigger that makes my system unstable - it is not the best script, a warning window to close apps would be kind!, but I thought it was s start.... I know you guys will tell me all about it...
But is the following a valid script to shutdown windoze XP (I have delimited with <start> and <end> - rest is pasted right out of file)...
<start>
'Begin shell script code'
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\windows\system32\cmd.exe"
'Wait until cmd.exe has loaded'
While WshShell.AppActivate("c:\windows\system32\cmd.exe") = FALSE
wscript.sleep 1000
Wend
'Bring cmd.exe to the foreground'
WshShell.AppActivate "c:\windows\system32\cmd.exe"
'Change directories and issue shutdown command
WshShell.SendKeys "cd{\}"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "cd windows{\}system32"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "shutdown -s"
WshShell.SendKeys "{ENTER}"
'End shell script code'
<end>
incase you wonder why... I am trying to run this when MBM jits a temperature trigger that makes my system unstable - it is not the best script, a warning window to close apps would be kind!, but I thought it was s start.... I know you guys will tell me all about it...