- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why do I sometimes (up to 33%) get the following message when running my *.exe file in batch mode: "The system can not find the file specified". The output from my exe file is o.dat. I am running this batch file in the dos window on my system for which the operating system is VISTA. A segment of the batch file is below:
@echo off
rem ***********************************
rem this batch file is for running multiples
rem of penetration curves
rem ***********************************
del o*.dat
rem ***********************************
rem ************STARTING CYCLE 1*******
time/t
start /wait PHEV_BATCH
ren o.dat o1.dat
echo done with cycle 1
rem goto end
rem ***********************************
It seems that sometimes the system, despite the /wait switch, is getting out ahead of the application before it has completed writing out the o.dat file.
Your suggestions would be appreciated.
thank you!
John
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
John,
When you receive the error message does o.dat exist?
If it does not exist then PHEV_BATCH did not create the file (or created it in a different directory than which you expected).
If it does exist (where it is expected) then this may be a lazy close issue. Try
start /wait PHEV_BATCH
:wait
if not exist o.dat goto wait
ren o.dat o1.dat
The above will hang if o.dat is not created. Consider the following
start /wait PHEV_BATCH
if not exist o.dat DIR >NULL
if not exist o.dat DIR >NULL
if not exist o.dat DIR >NULL
if not exist o.dat echo o.dat not found
if not exist o.dat ren o.dat o1.dat
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I hope you caught the error in the last statement (remove the "not")
Jim
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page