Using a batch file to check for file existence of a file.
Shrnutí: This article describes the steps for implementing batch files to check for file existence of a file.
Tento článek se vztahuje na
Tento článek se nevztahuje na
Tento článek není vázán na žádný konkrétní produkt.
V tomto článku nejsou uvedeny všechny verze produktu.
Příznaky
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.
Příčina
.
Řešení
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.
Dotčené produkty
SoftwareVlastnosti článku
Číslo článku: 000151505
Typ článku: Solution
Poslední úprava: 20 dub 2021
Verze: 4
Najděte odpovědi na své otázky od ostatních uživatelů společnosti Dell
Služby podpory
Zkontrolujte, zda se na vaše zařízení vztahují služby podpory.