Archive: IfFileExists


IfFileExists
I have a test for a file, and I get "true" when the file does not exist:

ClearErrors
; first check to see if file exists and skip if it doesn't
IfFileExists "c:\test.txt" Here NoFile
Here:
!ifdef DEBUG
!echo "File Exists"
!endif
,.
. code here
.and a jump
.
NoFile:
!ifdef DEBUG
!echo "File does not exist"
!endif

I always get the message "File Exists"


IfFileExists is a runtime instruction, what exactly you're trying to achieve?


!echo is a build-time instruction. You don't want that in this case since IfFileExists is a run-time check. Change your !echo to MessageBox or DetailPrint, which are run-time instructions.


Thank you for the help. I was trying to find out at runtime if a file existed or not. Your help is appreciated.