标题: [文本处理] 批处理怎样查找后缀为.vmx的文件并在文件最后写入内容? [打印本页]
作者: clock874 时间: 2020-3-5 10:51 标题: 批处理怎样查找后缀为.vmx的文件并在文件最后写入内容?
查找文件夹内所有后缀为vmx的文件,并在文件最后添加内容:
monitor_control.enable_fullcpuid = TRUE
cpuid.1.eax = "00001111111010111111101111111111"
cpuid.1.ebx = "00000000000000000000011011110001"
万分感谢!!!
作者: zaqmlp 时间: 2020-3-5 12:22
- @echo off
- set info=互助互利,支付宝扫码头像,感谢打赏
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- for /f "delims=" %%a in ('dir /a-d/b/s *.vmx') do (
- echo;"%%a"
- >>"%%a" echo;monitor_control.enable_fullcpuid = TRUE
- )
- :end
- echo;%info%
- pause
- exit
复制代码
作者: Batcher 时间: 2020-3-5 22:12
回复 1# clock874 - @echo off
- cd /d "%~dp0"
- for /f "delims=" %%i in ('dir /b /s /a-d *.vmx') do (
- > "%%~nxi.BatHome" type "%%i"
- >>"%%~nxi.BatHome" echo,
- >>"%%~nxi.BatHome" echo,monitor_control.enable_fullcpuid = TRUE
- >>"%%~nxi.BatHome" echo,cpuid.1.eax = "00001111111010111111101111111111"
- >>"%%~nxi.BatHome" echo,cpuid.1.ebx = "00000000000000000000011011110001"
- move /y "%%~nxi.BatHome" "%%i"
- )
复制代码
作者: clock874 时间: 2020-3-6 16:48
回复 3# Batcher
辛苦了!!!非常感谢!!!!
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |