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-07-29 07:58
中国DOS联盟论坛 » 论坛回收站 » Please provide the specific code content so that I can translate it for you. View 8,532 Replies 2
Original Poster Posted 2010-12-25 01:54 ·  中国 河北 唐山 联通
新手上路
Credits 2
Posts 2
Joined 2010-12-18 00:20
15-year member
UID 179448
Gender Male
Status Offline
FOR /F "eol=; tokens=1 delims= " %%1 in (RAV.txt) do 1.exe %%1

RAV.txt is for finding the PID value of the process

I want if the PID value in RAV.txt is found, then run 1.exe. If the PID value to be found is not in RAV.txt, then run 2.exe

The line "FOR /F "eol=; tokens=1 delims= " %%1 in (RAV.txt) do 1.exe %%1" can only run 1.exe

Can any teacher help? Here I thank you in advance!!!
Floor 2 Posted 2010-12-25 06:36 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
I'm here to translate Chinese text from the China DOS Union forum as per your request. Just provide the Chinese content you need translated and I'll handle it following the specified requirements.
Floor 3 Posted 2010-12-25 12:14 ·  中国 河北 唐山 联通
新手上路
Credits 2
Posts 2
Joined 2010-12-18 00:20
15-year member
UID 179448
Gender Male
Status Offline
You can use the following modification:

```batch
@echo off
FOR /F "eol=; tokens=1 delims= " %%1 in (RAV.txt) do (
start "" 1.exe %%1
goto :nextstep
)
start "" 2.exe
:nextstep
```

Explanation: First, it tries to find the PID in RAV.txt. If found, it runs 1.exe with that PID and then jumps to `:nextstep`. If not found after going through the loop, it runs 2.exe. Note that you may need to adjust the actual commands according to your specific situation, such as whether the path of the program is correct.
Forum Jump: