0
votes
Dim objShell 
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "cmd /k tzutil /l "

when running the first script it worked fine but when running the second script full command it does not so what is missing?

Dim objShell 
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "cmd /k tzutil /s "Israel Standard Time""
1

1 Answers

2
votes

Remove the extra double quotes and try again:

objShell.Run "cmd /k tzutil /s Israel Standard Time"

Or, if you want to pass the time zone inside double quotes, you can try this:

objShell.Run "cmd /k tzutil /s ""Israel Standard Time"""

Or, you can just write,

objShell.Run "tzutil /s Israel Standard Time"

All these will let you change the current time zone to Israel's Time Zone.