中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-03 13:03
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » for 是否不能以字符串作分割标志吗? 查看 1,024 回复 3
楼 主 for 是否不能以字符串作分割标志吗? 发表于 2007-03-05 01:54 ·  中国 广东 深圳 宝安区 电信
中级用户
★★
积分 379
发帖 95
注册 2003-07-17 00:00
23年会员
UID 7038
性别 男
状态 离线
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UltraISO_is1]
"Inno Setup: Setup Version"="5.1.8"
"Inno Setup: App Path"="C:\\Program Files\\UltraISO"
"InstallLocation"="C:\\Program Files\\UltraISO\\"
"Inno Setup: Icon Group"="UltraISO"
"Inno Setup: User"="Administrator"
"Inno Setup: Selected Tasks"="desktopicon,associate,isodrive"
"Inno Setup: Deselected Tasks"=""
"DisplayName"="UltraISO Premium V8.6"
"DisplayIcon"="C:\\Program Files\\UltraISO\\UltraISO.exe"
"UninstallString"="\"C:\\Program Files\\UltraISO\\unins000.exe\""
"QuietUninstallString"="\"C:\\Program Files\\UltraISO\\unins000.exe\" /SILENT"
"NoModify"=dword:00000001
"NoRepair"=dword:00000001
"InstallDate"="20070224"
我要提取"InstallLocation"="C:\\Program Files\\UltraISO\\"中的路径,C:\\Program Files\\UltraISO\\
用find或findstr出来都是整行内容"InstallLocation"="C:\\Program Files\\UltraISO\\"不是路径!
2 发表于 2007-03-05 02:35 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
积分 2,564
发帖 1,127
注册 2006-12-25 22:57
19年会员
UID 74552
性别 男
状态 离线
for /f "tokens=1-3 delims==\\" %i in ('findstr /i /b "installlocation"') do set ap=%i\%j\%k
3 发表于 2007-03-05 02:49 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
积分 2,725
发帖 1,160
注册 2006-09-23 12:00
19年会员
UID 63486
来自 河北廊坊
状态 离线
@echo off
for /f "tokens=2 delims==" %%i in ('findstr /i "installlocation" test.reg') do echo %%~i
pause>nul
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
4 发表于 2007-03-05 08:30 ·  中国 陕西 西安 电信
铂金会员
★★★★
积分 5,212
发帖 2,478
注册 2007-02-08 23:39
19年会员
UID 79003
性别 男
状态 离线
@echo off &setlocal enabledelayedexpansion
for /f "tokens=2 delims==" %%i in ('findstr /i "installlocation" test.reg') do (
set InPath=%%~i
set InPath=!Inpath:\\=\!
echo !Inpath!
)
pause >Nul
论坛跳转: