使用 BATCH FILE 根据当前时区值更改 PC 的时区

Changing PC's timezone according to current timezone value using a BATCH FILE

所以我正在尝试创建一个批处理文件以根据计算机上的当前时区更改计算机的时区(顺便说一句,在 Win 8.1 上工作)。 这是我目前所拥有的:

set current="timezone value"
if %current%=="S.A. Pacific Standard Time" TZUTIL s/"China Standard Time" else TZUTIL s/"S.A. Pacific Standard Time"

如何获取电脑的当前时区值以便正确设置 %current%? 有没有不使用 TZUTIL 的另一种方法?,你建议我怎么做?

for /f "delims=" %%a in ('TZUTIL /g') do set "current=%%a"
echo %current%

你的命令也有不正确的开关和比较缺少引号

if "%current%"=="S.A. Pacific Standard Time" (
  TZUTIL /s "China Standard Time"
) else (
  TZUTIL /s "S.A. Pacific Standard Time"
)