So I'm trying to build a batch file that will either automatically toggle between 2 time zones; or take a user input and change the time zone accordingly
I tried to have a toggle system but I can't figure out how to store the current time zone based on tzutil /g
or setup if statements correctly to identify which time zone to change to. I run it in admin mode so thats not the issue.
@echo off
echo The current time is:
tzutil /g
echo.
SET /p NewTimeZone="Enter the time zone you wish to change to: "
tzutil /s %NewTimeZone%
the first part works fine, it tell the user what time zone it's in and then asks to change it. however that last line is whats causing all the trouble, I can't seem to get it work, for example when I run the code, I type in: "Mountain Standard Time"
which is the string its needs to change the time however it never goes through, it just closes the program and the time zone never changes