Using a batch file to check for file existence of a file.

Zusammenfassung: This article describes the steps for implementing batch files to check for file existence of a file.

Dieser Artikel gilt für Dieser Artikel gilt nicht für Dieser Artikel ist nicht an ein bestimmtes Produkt gebunden. In diesem Artikel werden nicht alle Produktversionen aufgeführt.

Symptome

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.
 

Ursache

.

Lösung

Here is an example, perform the following steps to create a routine batch file.

  1. Click Start, and click Run.
  2. In the Open field, type CMD.
    A command prompt window appears.
  3. Type edit test.bat and press <Enter>.

    NOTE: The word test may be substituted with another word.
  4. Type :check_for_file_existence and press <Enter>.
  5. Type if exist c:\ftp\ftpfile.txt goto perform and press <Enter>.

    NOTE: The file ftpfile.txt may substituted with other files.
  6. Type sleep 200 and press <Enter>.

    NOTE: The number of seconds may be increaed or decreased from 200.
  7. Type goto check_for_file_existence and press <Enter>.
  8. 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.

 


 

Betroffene Produkte

Software
Artikeleigenschaften
Artikelnummer: 000151505
Artikeltyp: Solution
Zuletzt geändert: 20 Apr. 2021
Version:  4
Antworten auf Ihre Fragen erhalten Sie von anderen Dell NutzerInnen
Support Services
Prüfen Sie, ob Ihr Gerät durch Support Services abgedeckt ist.