中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-13 22:14
47,812 topics / 349,916 posts / today 0 new / 48,268 members
论坛回收站 » Please provide the specific code content so that I can translate it for you.
Printable Version  8,701 / 2
Floor1 tangnox Posted 2010-12-25 01:54
新手上路 Posts 2 Credits 2
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!!!
Floor2 Hanyeguxing Posted 2010-12-25 06:36
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
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.
Floor3 tangnox Posted 2010-12-25 12:14
新手上路 Posts 2 Credits 2
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.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023