I'm sure this can be done in 15 seconds by those who know how...
I'm looking for a batch/cmd file that will run another program/command for every filename in the release/download directory (%1 if I'm not mistaken). The command to be run doesn't support wildcards so it needs to be fed each and every filename.
Would also be great if the script waits for the command to end before proceeding to feeding it the next filename.
Thanks in advance!
[windows] need help with making a script
Re: [windows] need help with making a script
Just out of curiosity, what is this mystery program that you want to run for each file?
Also, what kind of self-insulting username is that?
Also, what kind of self-insulting username is that?
Last edited by TeraLove on July 30th, 2009, 9:51 pm, edited 1 time in total.
Re: [windows] need help with making a script
It's actually an SFV-checker of sorts but not.TeraLove wrote: Just out of curiosity, what is this mystery program that you want to run for each file?
Also, what kind of self-insulting username is that?
You don't like my nick, haha? My girlfriend gave it to me, hahaha.
Re: [windows] need help with making a script
Wow that's a very clear description. Thank you. Anyhow, what do I care.Assmonkey wrote:It's actually an SFV-checker of sorts but not.
You might like to see http://www.urbandictionary.com/define.p ... =assmonkey for the meanings associated with your nick. Maybe then you'll understand. Makes me wonder why a girl would give her boyfriend such a nickname.Assmonkey wrote:You don't like my nick, haha? My girlfriend gave it to me, hahaha.
Maybe someone can help with your technical concern.
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: [windows] need help with making a script
I know teralove will tell me off for this as it's not generic but this should do what you want
this will work on any .iso. if you want all files you can use just * otherwise *.whatever
just substitute the DIR for the command you want to run
Code: Select all
set dirname=%1
set dirname=%dirname:"=%
set name=%3
set name=%name:"=%
set nbID=%4
set DLTYPE=%5
for /R "%dirname%" %%f in (*.iso) do call :doit "%%f"
GOTO :EOF
:doit
REM the file you want is now in %1 and already has quotes around it
DIR %1
GOTO :EOF
just substitute the DIR for the command you want to run
Last edited by doubledrat on July 31st, 2009, 4:56 am, edited 1 time in total.
Re: [windows] need help with making a script
Hehe, seems I managed to do it myself after all. No idea whose is the better solution though.
Here's mine:
Here's mine:
Code: Select all
FOR /F "usebackq" %%i IN (`dir /B %1`) DO mycmd.exe="%1\%%i"
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: [windows] need help with making a script
yours is fine as long as you never want to do more than 1 command and your files are not in subdirectories
Re: [windows] need help with making a script
you could add a /S to the dir as long as you get all the tokens as one with tokens=1* and delims={somecharacterthatwon'tappearinfilenames} in the options.doubledrat wrote: yours is fine as long as you never want to do more than 1 command and your files are not in subdirectories
Code: Select all
FOR /F "usebackq tokens=1* delims=*" %%i IN (`dir /B /S %1`) DO mycmd.exe="%1\%%i"