|
|
发表于 2016-7-18 15:55:33
|
显示全部楼层
- @echo off
- set d=-1
- for /f "tokens=3" %%a in ('reg query "HKEY_CURRENT_USER\Control Panel\International" /v sShortDate') do set RegDateOld=%%a
- reg add "HKEY_CURRENT_USER\Control Panel\International" /v sShortDate /t REG_SZ /d yyyy-MM-dd /f >nul
- for /f %%a in ('mshta VBScript:Execute("NewDate=date()+(%d%):FmtDate=right(year(NewDate),4)&right(""0""&month(NewDate),2)&right(""0""&day(NewDate),2):CreateObject(""Scripting.FileSystemObject"").GetStandardStream(1).Write FmtDate:close"^)') do set dstDate=%%a
- echo;%dstDate%
- reg add "HKEY_CURRENT_USER\Control Panel\International" /v sShortDate /t REG_SZ /d %RegDateOld% /f >nul
- pause
复制代码 |
|