Using a batch file to check for file existence of a file.
Summary: This article describes the steps for implementing batch files to check for file existence of a file.
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Symptoms
Use a batch file routine to check for the existence of a file.
You can run a batch file from the command to check for the existence of a file and then perform a routine when it arrives.
NOTE: The sleep.exe program is required to be installed prior to running the batch file and is supplied with the Windows NT Resource Kit.
Cause
.
Resolution
Here is an example, perform the following steps to create a routine batch file.
- Click Start, and click Run.
- In the Open field, type CMD.
A command prompt window appears. - Type edit test.bat and press <Enter>.
NOTE: The word test may be substituted with another word. - Type :check_for_file_existence and press <Enter>.
- Type if exist c:\ftp\ftpfile.txt goto perform and press <Enter>.
NOTE: The file ftpfile.txt may substituted with other files. - Type sleep 200 and press <Enter>.
NOTE: The number of seconds may be increaed or decreased from 200. - Type goto check_for_file_existence and press <Enter>.
- Type :perform and press <Enter>.
NOTE: This routine checks for ftpfile.txt every 200 seconds. This type of routine is useful when you need to run a program once a file has been sent via FTP to your computer.
Affected Products
SoftwareArticle Properties
Article Number: 000151505
Article Type: Solution
Last Modified: 20 Apr 2021
Version: 4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.