Sorry if I'm asking a very silly question, but I'm a bit rusty in writing simple batch scripts but I'm running into an issue. I wanted to write a script that will change a local admin password depending on the day of the week. The script runs but just runs the first label and skips the IF statements, and I'm a little unsure of what the issue might be.
FOR /F "skip=1" %%A IN ('WMIC Path Win32_LocalTime Get DayOfWeek') DO (
set DOW=%%A
)
IF DOW == 0 goto SUN
IF DOW == 1 goto MON
IF DOW == 2 goto TUE
IF DOW == 3 goto WED
IF DOW == 4 goto THU
IF DOW == 5 goto FRI
IF DOW == 6 goto SAT
:SUN
net user admin Password0
GOTO END
:MON
net user admin Password1
GOTO END
:TUE
net user admin Password2
GOTO END
:WED
net user admin Password3
GOTO END
:THU
net user admin Password4
GOTO END
:FRI
net user admin Password5
GOTO END
:SAT
net user admin Password6
GOTO END
:END