- 完美解决了
-
- @echo off
- ::【增加头尾 (保存为原名)】
- for /r . %%i in (*.cmd) do (
- type "%%i">%temp%\a.cmd
- (
- echo @echo off
- type %temp%\a.cmd
- echo exit
- )>"%%i"
- )
- exit
- +++++++++++++++++++++++++++++++++++++++++++++++++
- 下面简洁:
-
- ::【加头尾 (重命名为:注册表名.bat) (其中:%~n1————注册表名{无后缀})】
- move "*.cmd" "a.cmd"
- (
- echo @echo off
- type a.cmd
- echo exit
- )>"%~n1.bat"
- del *.cmd
复制代码
|