@echo off setlocal enabledelayedexpansion chcp 65001 > nul REM 获取当前日期,格式为MM/dd/yyyy for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set datetime=%%a set "year=!datetime:~0,4!" set "month=!datetime:~4,2!" set "day=!datetime:~6,2!" set "date=!month!/!day!/!year!" REM 设置注册表项 reg add "HKEY_CURRENT_USER\Software\Typora" /v IDate /t REG_SZ /d "!date!" /f > nul endlocal