- @echo off
- REM **********************************************************************************
- REM 管理员权限
- >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
- if '%errorlevel%' NEQ '0' (
- goto UACPrompt
- ) else ( goto gotAdmin )
- :UACPrompt
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
- echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
- "%temp%\getadmin.vbs"
- exit /B
- :gotAdmin
- if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
- REM **********************************************************************************
-
- REM 代码
- REM 双击bat文件删除或添加该功能
- 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
- reg delete "HKCR\*\shell\复制「修改时间」" /f 2>nul && echo 删除成功! || (
- reg add HKCR\*\shell\复制「修改时间」\command /ve /d "%cmd%" /f
- echo 添加成功!
- )
- pause
复制代码
|