China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-04 01:07
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Need a solution! View 679 Replies 4
Original Poster Posted 2007-04-04 09:24 ·  中国 山东 济南 联通
初级用户
Credits 30
Posts 12
Joined 2007-04-04 01:19
19-year member
UID 83876
Gender Male
Status Offline
Floor 2 Posted 2007-04-04 09:31 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
for /f "tokens=2* delims==" %%? in ('type life^|findstr "^执行程序="') do (
set "v=%%?"
if not defined v (echo There is no program name on the 执行程序 line)
)
pause

Something like this
Floor 3 Posted 2007-04-04 11:26 ·  中国 山东 济南 联通
初级用户
Credits 30
Posts 12
Joined 2007-04-04 01:19
19-year member
UID 83876
Gender Male
Status Offline
It doesn't work, I already tried it, and it gives an error when run!
Floor 4 Posted 2007-04-04 11:44 ·  中国 广东 广州 电信
高级用户
★★★
潜水修练批处理
Credits 788
Posts 366
Joined 2006-12-31 02:43
19-year member
UID 75048
Gender Male
Status Offline
type life^|findstr "^执行程序="

According to the OP's requirement, this should be:

type 设置.ini ^|findstr "^执行程序="
Floor 5 Posted 2007-04-04 11:56 ·  中国 山东 济南 联通
初级用户
Credits 30
Posts 12
Joined 2007-04-04 01:19
19-year member
UID 83876
Gender Male
Status Offline
How do I detect whether 设置.ini has
执行程序= (if there is a line with this content, I need to detect whether there is exit.exe after the equals sign; it may not necessarily be exit.exe, it could also be run.bat)
There may be several lines like 执行程序=xxx.xxx in this file
The above batch file doesn't work!
Forum Jump: