Tech Tips / Windows NT / Disk and File Management

Using a batch file to check for file existence

Did you know that it's possible to use a batch file to check for the existence of a file and then perform a routine when it arrives? This routine comes in handy when you need to run a program after a file has been sent via FTP to your computer. To run this routine, type the following:

  :check for file existence
  if exist c:/ftp/ftpfile.txt goto perform
  sleep 200
  goto perform
  :perform

This routine checks for the existence of the Ftpfile.txt file every 200 seconds. To run this routine, you'll need the Sleep.exe program, which can be found in the Windows NT Resource Kit.

Contact Us | Authors | Subject Index | Directory | RSS Feeds

Copyright ©2006 Setup32.com