| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
Batch Files
|
Original Message
|
Name: rickz
Date: August 7, 2006 at 07:38:53 Pacific
Subject: Batch FilesOS: win xpCPU/Ram: p4Model/Manufacturer: pb |
Comment: Hi there. I WANT TO DELAY A BATCH FILE UNTIL IT HAS FOUND A PARTICULAR FILE FROM A DIRECTORY AND KEEP PROCESSING AFTER IT FINDS IT. THANK YOU
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Mechanix2Go
Date: August 7, 2006 at 09:00:46 Pacific
|
Reply: (edit)In general, a batch executes one line at a time. So it will "delay" while it's finding the file. If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: rickz
Date: August 7, 2006 at 11:54:29 Pacific
|
Reply: (edit)sorry, i forgot to mention: Suppose i am compiling a java file and a batch file is associated with the java file and they both execute simultaneously. so, the funtion of my batch file is to delete all .cls files created by the java compiler. By this time my batch programme waits until it finds .cls file. but if i press any key on mybatch_file before the java compiler completes comiling, the batch programme will exit, since it didn't find any .cls file.
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: Shr0Om
Date: August 8, 2006 at 03:35:49 Pacific
|
Reply: (edit)This could be a way.. If no cls files are found, the script will wait for about 3 sec's and check again. If found, del and exit. Although, this means that if there's only one cls file, it will exit after deleting it, thus not removing perhaps other cls files.. @echo off :start if exist *.cls (del *.cls & exit) else ping localhost -n 3 >nul & goto start
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Programming Forum Home