Here is what I have, it works great if you remove the attempt to setup the if statement, but as windows 2000 and xp SP1 do not have powercfg I have to find a way to limit which version of windows this runs on. I am still in a position of no formal training in vb so I am just hacking this out from trial and error at this point.
Set oShell = CreateObject("Wscript.Shell")
Set version = oShell.Run "ver"
If( UCase( Trim( version ) ) = UCase( Trim( "Microsoft WIndows XP [Versopm 5.1.2600]" ) ) )
Then
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -monitor-timeout-ac 15", 0, True
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -disk-timeout-ac 25", 0, True
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -standby-timeout-ac 0", 0, True
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -hibernate-timeout-ac 0", 0, True
oShell.Run "powercfg.exe -hibernate off", 0, True
oShell.Run "powercfg.exe -setactive ""Home/Office Desk""", 0, True
End If
Set oShell = CreateObject("Wscript.Shell")
Set version = oShell.Run "ver"
If( UCase( Trim( version ) ) = UCase( Trim( "Microsoft WIndows XP [Versopm 5.1.2600]" ) ) )
Then
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -monitor-timeout-ac 15", 0, True
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -disk-timeout-ac 25", 0, True
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -standby-timeout-ac 0", 0, True
oShell.Run "powercfg.exe -change ""Home/Office Desk"" -hibernate-timeout-ac 0", 0, True
oShell.Run "powercfg.exe -hibernate off", 0, True
oShell.Run "powercfg.exe -setactive ""Home/Office Desk""", 0, True
End If