• <file> "was unexpected at this time." (Completely confused)
    4 replies, posted
(Note: I am a total noob at batch files) Since I really did not want to do all files manually convert 1000s of files by typing I tried to make a batch file. Each filename is "interface_media_<number with 5 digits>.wav so for example command: "quickconvert.bat interface_media". The batch file adds the number and .wav at the end during the process. (Probably made no sense) Keeps giving me the error in the title. It has something to do with the IF NOT EXISTS. I honestly do not know if this is the correct forums, even though it really isn't coding, it doesn't fit anywhere else. [CODE]@echo off set /a var=0 :1DIGIT if NOT %var% LSS 10 goto :2DIGIT ECHO Checking File... if NOT EXISTS %1_0000%var%.wav :EXIT ECHO Converting %1_0000%var% . D:\Tools\SR3\ww2ogg.exe %1%_0000%var%.wav ECHO Converting %1_0000%var% .. D:\Tools\SR3\revorb.exe %1_0000%var%.ogg ECHO Converting %1_0000%var% ... cls set /a var+=1 goto 1DIGIT :2DIGIT if NOT %var% LSS 100 goto :3DIGIT ECHO Checking File... if NOT EXISTS %1_000%var%.wav :EXIT ECHO Converting %1_000%var% . D:\Tools\SR3\ww2ogg.exe %1_000%var%.wav ECHO Converting %1_000%var% .. D:\Tools\SR3\revorb.exe %1_000%var%.ogg ECHO Converting %1_000%var% ... cls set /a var+=1 goto 2DIGIT :3DIGIT if NOT %var% LSS 1000 goto :4DIGIT ECHO Checking File... if NOT EXISTS %1_00%var%.wav :EXIT ECHO Converting %1_00%var% . D:\Tools\SR3\ww2ogg.exe %1_00%var%.wav ECHO Converting %1_00%var% .. D:\Tools\SR3\revorb.exe %1_00%var%.ogg ECHO Converting %1_00%var% ... cls set /a var+=1 goto 3DIGIT :4DIGIT if NOT %var% LSS 10000 goto :5DIGIT ECHO Checking File... if NOT EXISTS %1_0%var%.wav :EXIT ECHO Converting %1_0%var% . D:\Tools\SR3\ww2ogg.exe %1_0%var%.wav ECHO Converting %1_0%var% .. D:\Tools\SR3\revorb.exe %1_0%var%.ogg ECHO Converting %1_0%var% ... cls set /a var+=1 goto 4DIGIT :5DIGIT if NOT %var% LSS 100000 goto :END ECHO Checking File... if NOT EXISTS %1_%var%.wav :EXIT ECHO Converting %1_%var% . D:\Tools\SR3\ww2ogg.exe %1_%var%.wav ECHO Converting %1_%var% .. D:\Tools\SR3\revorb.exe %1_%var%.ogg ECHO Converting %1_%var% ... cls set /a var+=1 goto 5DIGIT :END ECHO Conversion Complete![/CODE] P.S. Glad to see someone thinks this is funny and fails to help at all... P.S.S. No really, I do need some help with this. And I seriously doubt that I'm a programming king, just sayin'
pretty sure it's supposed to be if not EXIST not EXIST[b]S[/b]
[QUOTE=Shadaez;39040968]pretty sure it's supposed to be if not EXIST not EXIST[b]S[/b][/QUOTE] I saw that on a google search as well, though then it just throws me a Syntax error so yeah...weirdness. Not that I understand the syntax of a batch file in the first place, I'm literally just stumbling in the dark here.
I'm not sure anyone here is versed enough in Windows batch files to be able to help out much - they are kind of a migraine to deal with :v: What exactly are you trying to do here? Convert a buttload of wav files to ogg?
yeah I could probably do this in python but I dont get batch
Sorry, you need to Log In to post a reply to this thread.