
CODE: [Copy to clipboard]@echo off
set V_productInstalloc=QQ,c:\program files\QQ/MSN,c:\program files\MSN/messager,c:\program files\messager
call :check
:loop
set V_productInstalloc=%V_productInstalloc:*/=%
:check
for /f "tokens=1 delims=/" %%i in ("%V_productInstalloc%") do (echo %%i)
echo "%V_productInstalloc%"|find /i "/">nul 2>nul && goto loop
pause
CODE: [Copy to clipboard]在写批处理脚本的时候,尽量养成能用引号就用引号的习惯。因为对付无处不在的特殊字符,空格,比较有效的方法就是用引号包起来。@echo off
set str="QQ,c:\program files\QQ|MSN,c:\program files\MSN|messager,c:\program files\messager"
set str=%str:|=" "%
call :print %str%
pause
goto :eof
for %%i in (%*) do echo %%~i
goto :eof
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |