Values dependant of input file name

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
darkelf5
Posts: 2
Joined: 28 Aug 2009 13:20

Values dependant of input file name

#1 Post by darkelf5 » 28 Aug 2009 13:42

Hi. This is a total noob question, but plz help me.
I have a batch file that does some video processing when you drag a file onto it.
How can i get it to set differente value for certain files i drag? For example
If input file is 1.avi then SOMEVALUE=500. I've tried if %1=1.avi then... But it gives me an error.
Oh yeah, and another thing. Earlier i could just tupe shutdown.exe in my scripts and my computer would shutdown. Now i have to type the whole path win\system32\shutdown.exe because my batch script start in the folder they are residing.

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 28 Aug 2009 15:34

Try:

if "%~nx1"=="1.avi"

shutdown is dependent on your path variable. Is win/system32 in your path? Sounds like your path is messed up.

darkelf5
Posts: 2
Joined: 28 Aug 2009 13:20

#3 Post by darkelf5 » 29 Aug 2009 04:59

Thank you.

Post Reply