本帖最后由 went 于 2020-7-9 18:41 编辑
文件右键菜单,双击添加或删除,ANSI编码- @echo off
- REM 管理员权限
- %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","REM",,"runas",1)(window.close)&exit
- REM 目标盘符
- set "tagDriver=e:"
- REM 右键菜单名称
- set "msg=发送到%tagDriver%"
- REM 添加或删除
- set "command=cmd /q /c \"for /f \"delims=\" %%%%i in (\"%%1\") do xcopy /f /y \"%%%%i\" \"%tagDriver%%%%%~pi\"\" & pause"
- reg delete "HKCR\*\shell\%msg%" /f 2>nul && echo 删除完成! || reg add "HKCR\*\shell\%msg%\command" /ve /t REG_SZ /d "%command%" /f && echo 添加完成! ---^> %msg% || echo 添加失败!
- pause&exit
复制代码
|