only do if day… batch file

后端 未结 7 1724
南笙
南笙 2021-02-09 00:43

hello i got a batch file, something like this:

if %day%==monday, tuesday, wednesday, thursday, friday (
goto yes
) else (
goto no
)

Now i know

7条回答
  •  隐瞒了意图╮
    2021-02-09 01:14

    I ran across this online. Tested, and it works. Returns the day as an integer, which you can still work with.

    @For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @( 
        Set Month=%%A
        Set Day=%%B
        Set Year=%%C
    )
    
    @echo DAY = %Day%
    @echo Month = %Month%
    @echo Year = %Year%
    

提交回复
热议问题