You can use the IF EXIST statement to check for the presence of a
file or directory:
To check if the file "file.exe" exists in the directory temp:
To check if the file "file.exe" exists in the directory temp:
IF EXIST c:\temp\file.exe ECHO File exists!
To check if a the directory "temp" exists (Notice the nul):
IF EXIST c:\temp\nul ECHO Directory exists!
Regards
Nessun commento:
Posta un commento