I am running a batch file "batch.bat" Inside the batch file i am calling a VB exe file "test.exe". Within the VB I am trying to open a text file "new.txt".

I am stuck at passing an error message or some variable back to batch file "batch.bat" when the text file "new.txt" is not found.

I appreciate if someone can help me with this.

Thanks,
Kiran

u can try the DIR function to check whether the file does exist or not.here is a sample :

if dir("c:\test.txt")<>"" then
msgbox "file found"
else
msgbox "file not found"
endif