- @echo off
- %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
- chcp 65001&cls
- set "cmd=cmd /E:ON /V:ON /c for %%%%i in ("%%1") do set time=%%%%~ti&set /p="本文件修改时间为 !time:~0,4!.!time:~5,2!.!time:~8,2! !time:~11,2!:!time:~14,2!。"<nul|clip"
- set "cmd=%cmd:"=\"%"
- reg delete "HKCR\*\shell\复制「修改时间」" /f 2>nul && echo 删除成功! || reg add HKCR\*\shell\复制「修改时间」\command /ve /d "%cmd%" /f && echo 添加成功! || echo 添加失败!
- pause
复制代码
|