Batch file help
Moderator: DosItHelp
Batch file help
Hi,
I have a compiled binary which allows me to drop a video file onto it and it then makes some small fixes to the file and then outputs a fixed file into the same folder as the original.
So I drag and drop abc.flv onto and it produces a second file called abc.fix.flv in the same folder as abc.flv
It only works with one file at a time and I was hoping to write a batch file which allowed me to drag multiple video files onto it and have them processed one after the other.
Thanks for any help.
I have a compiled binary which allows me to drop a video file onto it and it then makes some small fixes to the file and then outputs a fixed file into the same folder as the original.
So I drag and drop abc.flv onto and it produces a second file called abc.fix.flv in the same folder as abc.flv
It only works with one file at a time and I was hoping to write a batch file which allowed me to drag multiple video files onto it and have them processed one after the other.
Thanks for any help.
Re: Batch file help
My suggestion:
Code: Select all
@echo off
:loop
if not "%1"=="" start /w "" "CompiledBinary.EXE" "%1"
shift
if not "%1"=="" goto :loop
Re: Batch file help
mfm4aa wrote:My suggestion:
It just needs some tildas - see below.
Code: Select all
@echo off
:loop
if not "%~1"=="" start /w "" "CompiledBinary.EXE" "%~1"
shift
if not "%~1"=="" goto :loop
Re: Batch file help
Thanks very much for the help, worked great.
-
- Posts: 2
- Joined: 25 Feb 2013 19:18
Re: Batch file help
I have a file that im doing and it calls for this code
but it doesn't work please help. I was wondering if you can change a varaible within a if statement with that varible (if %x% equ 1 DO (set /a x=2)
Code: Select all
FOR /F "tokens=1-6 delims=," %%G IN (bin/dir/saves/1.txt) DO (
set /a house=%%G
set /a weapon=%%H
set /a damage=%%I
set /a range=%%J
set /a defense=%%K
set /a money=%%L
)
:test
if %house% equ 1 DO (
set %house% equ school
if %house% equ 2 DO (
set %house% equ Gas Station
if %house% equ 3 DO (
set %house% equ Market
if %house% equ 4 DO (
set %house% equ House
but it doesn't work please help. I was wondering if you can change a varaible within a if statement with that varible (if %x% equ 1 DO (set /a x=2)
Re: Batch file help
Try this:
Code: Select all
FOR /F "tokens=1-6 delims=," %%G IN (bin/dir/saves/1.txt) DO (
set house=%%G
set weapon=%%H
set damage=%%I
set range=%%J
set defense=%%K
set money=%%L
)
:test
if %house% equ 1 (set house=school)
if %house% equ 2 (set house=Gas Station)
if %house% equ 3 (set house=Market)
if %house% equ 4 (set house=House)
-
- Posts: 2
- Joined: 25 Feb 2013 19:18
Re: Batch file help
That you so much! it worked just fine!