Manfredtoo
asked on
Using powercfg with vbscript
Hi Experts
i have a piece of code here need some help, i couldnt get it run smoothly. my objective is to set the power management option with vbs. is there anything wrong with my sytax?
cheers
i have a piece of code here need some help, i couldnt get it run smoothly. my objective is to set the power management option with vbs. is there anything wrong with my sytax?
cheers
Dim objShell:Set objShell=CreateObject("Wscript.Shell")
On Error Resume Next
With objShell
.Run "cmd powercfg /setactive "Home/Office Desk""
.Run "cmd powercfg /x "Home/Office Desk" /monitor-timeout-ac 0"
.Run "cmd powercfg /x "Home/Office Desk" /monitor-timeout-dc 0"
.Run "cmd powercfg /x "Home/Office Desk" /disk-timeout-ac 0"
.Run "cmd powercfg /x "Home/Office Desk" /disk-timeout-dc 0"
.Run "cmd powercfg /x "Home/Office Desk" /standby-timeout-ac 0"
.Run "cmd powercfg /x "Home/Office Desk" /standby-timeout-dc 0"
.Run "cmd powercfg /x "Home/Office Desk" /hibernate-timeout-ac 0"
.Run "cmd powercfg /x "Home/Office Desk" /hibernate-timeout-dc 0"
End With
wscript.quit
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
steve: i tried again, it shows me error: expected end of statement.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
chandru: it works great =) thanks alot. hey been seeing u helping me quite a few times. really appreciate it
Glad i was of help! No worries
cheers
Chandru
cheers
Chandru
ASKER
powercfg with vbs
ASKER