-3

I have small batch file to upgrade my program, if I run this batch file from any drive except C: drive it works correctly.

I'm trying this command

@ECHO OFF

IF EXIST C:\TWA\DRV.TXT GOTO TST1
DIR *.EXE /P
PAUSE

:TST1
DIR ASHOK.ZIP
PAUSE

I'm working on Windows 8.1

Compo
  • 36,585
  • 5
  • 27
  • 39

1 Answers1

0

I would add a goto end to avoid running the TST1 section if DRV.TXT is not found.

@ECHO OFF

IF EXIST C:\TWA\DRV.TXT GOTO TST1
DIR *.EXE /P
goto end
PAUSE

:TST1
DIR ASHOK.ZIP
PAUSE

:END
echo Finished!
pause
Ozymandias
  • 31
  • 7