不附加星期

@echo off
set /P NAME=<D:\ERP\1.txt
set YEAR=%date:~0,4%
set MONTH=%date:~5,2%
set DAY=%date:~8,2%
if /i "%MONTH:~0,1%" equ "0" (echo>D:\ERP\DengLu.ini LoadDay=%YEAR%/%MONTH:~1,2%/%DAY%) else (echo>D:\ERP\DengLu.ini LoadDay=%YEAR%/%MONTH:~0,2%/%DAY%)
echo>>D:\ERP\DengLu.ini LoadName=%NAME:~0,-1%
start D:\ERP\ERP.exe

附加星期(写法还可以优化一点)

@echo off
set /P NAME=<D:\ERP\1.txt
set YEAR=%date:~0,4%
set MONTH=%date:~5,2%
set DAY=%date:~8,2%
if %date:~-3%==周一 (set WEEK=星期一)
if %date:~-3%==周二 (set WEEK=星期二)
if %date:~-3%==周三 (set WEEK=星期三)
if %date:~-3%==周四 (set WEEK=星期四)
if %date:~-3%==周五 (set WEEK=星期五)
if %date:~-3%==周六 (set WEEK=星期六)
if %date:~-3%==周日 (set WEEK=星期日)
if /i "%MONTH:~0,1%" equ "0" (echo>D:\ERP\DengLu.ini LoadDay=%YEAR%/%MONTH:~1,2%/%DAY% %WEEK%) else (echo>D:\ERP\DengLu.ini LoadDay=%YEAR%/%MONTH:~0,2%/%DAY% %WEEK%)
echo>>D:\ERP\DengLu.ini LoadName=%NAME:~0,-1%
start D:\ERP\ERP.exe
最后修改:2020 年 03 月 13 日 06 : 19 PM