Batch file if statement error

gameman

It's been a long, long time.
Reaction score
95
It may be something silly but I keep getting the same error
"File Doesn't Exist!"

Code:
:loop
set /p song!a!=Enter song name %a%:
if not exist %song!a!%.wav (if exist %song!a!%.mp3 ( set song%a%=%song!a!%.mp3 ) else (Echo File Doesnt Exist!
set /a a=%a%-1))

set /a a=%a%+1
if %a% GTR %sngs% goto endloop
goto loop
:endloop

Edit
I found out why! for some reason the if statement doesn't like %song!a!% but it does like !song%a%!. I fixed it by tinkering with it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top