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-02 08:02
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Usage of the if statement? [Closed] View 1,686 Replies 7
Original Poster Posted 2006-10-24 23:16 ·  中国 广西 贵港 电信
高级用户
★★
学无尽止
Credits 635
Posts 244
Joined 2006-04-15 05:07
20-year member
UID 53857
Gender Male
From 广西贵港
Status Offline
I want to write a batch script to run a program. The requirement is: If there is a folder named logo in D:\netgame\logo, then run start D:\netgame\logo\logos.js; if not, exit.

[ Last edited by namejm on 2006-10-28 at 12:01 AM ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
namejm -4 2006-10-25 00:25
Floor 2 Posted 2006-10-24 23:33 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
如果存在D:\netgame\logo\logos.js,则启动D:\netgame\logo\logos.js

Translated:
If EXIST D:\netgame\logo\logos.js start D:\netgame\logo\logos.js
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
+4 2006-10-25 21:24
Floor 3 Posted 2006-10-24 23:41 ·  中国 广西 贵港 电信
高级用户
★★
学无尽止
Credits 635
Posts 244
Joined 2006-04-15 05:07
20-year member
UID 53857
Gender Male
From 广西贵港
Status Offline
Oh, looking at the LZ's writing is so simple. I've been trying for a long time without success. It seems I need to often come here to recharge!
Floor 4 Posted 2006-10-24 23:44 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 5 Posted 2006-10-25 00:11 ·  中国 广西 贵港 电信
高级用户
★★
学无尽止
Credits 635
Posts 244
Joined 2006-04-15 05:07
20-year member
UID 53857
Gender Male
From 广西贵港
Status Offline
Just ask casually.
If there is a .logo1_vir file under drive D, then execute this line: del D:\**.logo1_vir /f/s/q/a.
If not, exit.
How to do it!
Thanks!
Floor 6 Posted 2006-10-25 00:15 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Oh, the moderator has already demonstrated it to you once. Why still don't you get it?
Floor 7 Posted 2006-10-25 01:48 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
如果存在D:\*.logo1_vir,则删除D:\**\logo1_vir,使用/f/s/q/a参数
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
+4 2006-10-25 21:25
Floor 8 Posted 2006-10-27 15:46 ·  中国 广西 贵港 电信
高级用户
★★
学无尽止
Credits 635
Posts 244
Joined 2006-04-15 05:07
20-year member
UID 53857
Gender Male
From 广西贵港
Status Offline
Well, finally finished the task, thank you very much for qwe1234567's help!
Forum Jump: