Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking file existence in DOS!!!!!!!!

Status
Not open for further replies.

Nithya

Technical User
Jul 18, 2001
15
PH
we are working on conversion of foxpro table data to oracle through a text file.we are through with it.we need to automate the process.at the command prompt,we tried to automate by creating a batch file.we have to check the existence of the text file used during conversion.can anyone help us out on checking the file existence in DOS.
thanks in advance
nithya
 
if exist <filename> <your command>
 
Here is a script that I use:
Code:
echo _____________________________   >>&quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot;
Date /T  >&quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot;
Time /T  >>&quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot;
del /Q &quot;\\D740015\FTP\Reports\agent.txt&quot;
if exist &quot;\\D740000\Public\Force Mngmt\Reports\Agent Report\Mike's Reports2.prn&quot; goto FileFound
goto FileNotFound
:FileFound
echo File Found!  >>&quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot; 
&quot;\\D740015\D$\Program Files\Monarch\program\monarch.exe&quot; &quot;\\D740000\Public\Force Mngmt\Reports\Agent Report\Mike's Reports2.prn&quot; &quot;\\D740015\FTP\Scripts\agent.mod&quot; &quot;\\D740015\FTP\Reports\agent.txt&quot; /T
del /Q &quot;\\D740000\Public\Force Mngmt\Reports\Agent Report\Mike's Reports2.prn&quot;
echo File processing completed at: >> &quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot;
Date /T >>&quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot;
Time /T >>&quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot;
goto end
:FileNotFound
echo File Not Found!  >>&quot;\\D740015\FTP\Scripts\Logs\agent.txt&quot;
:end
Terry M. Hoey

Please read the following FAQ to learn how to help me help you...

faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top