
标题: [文件操作] 文件名有空格怎么处理? [打印本页]
作者: zhoubin 时间: 2017-4-21 18:15 标题: 文件名有空格怎么处理?
如题,求教高手:
find文件有空格怎么写批处理?- %windir%\System32\reg.exe query HKLM\SYSTEM\CurrentControlSet\Control /v SystemStartOptions|%windir%\System32\find.exe "MININT"&&(SET TheOS=WinPE)
- for /f "tokens=1* delims=[" %%a in ('ver') do set b=%%b
- set b=%b:* =%
-
- Set RegFile="%WinDir%\DOTNET 3.5 FOR XP.reg"&&call :RpRegPath
- regedit.exe /S %RegFile%
- exit
-
- :RpRegPath
- @echo off
- if %b:~0,2%%PROCESSOR_ARCHITECTURE:~-1%==5.6 set "Sth=X:\\WXPE"
- if not %b:~0,2%%PROCESSOR_ARCHITECTURE:~-1%==5.6 set "Sth=X:\\Windows"
- set "pth=C:\\Windows"
- (for /f "delims=" %%a in ('%Windir%\System32\find.exe /n /v ""^<%RegFile%') do (
- set "str=%%a"
- setlocal enabledelayedexpansion
- set "str=!str:%Sth%=%pth%!"
- set "str=!str:*]=!"
- echo,!str!
- endlocal
- ))>%temp%\RegFile.reg
- del %RegFile%&© %temp%\RegFile.reg %RegFile%&&del %temp%\RegFile.reg
- goto :eof
复制代码
批处理节选如上,本人菜鸟,不会写了。。。。
完整批处理,在win7 64位下运行可以,在xp下注册表文件没有处理。。。
注册表文件名带空格,可能是这个问题,高手给指点一下。。。
作者: yuboabc 时间: 2017-4-21 18:32
findstr /c:"要查找的内容"
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |