Compiled batch file won't execute properly

G

Guest

@echo off
for %%i in (%*) do exifiron -R -E -b %%i

The file is designed to rotate jpeg images using the program exifiron.
Anyway, the batch file will process an unlimited number of images at one
time, but when I compile the file into an executable it will only
process a maximum of two images. If I try to feed it more than two images
at a time it won't process anything. I've tried several different compilers
and the results are always the same.

I've tried various changes suggested to me but nothing has worked to
eliminate this limitation.

Any help would be much appreciated.
Mike
 
H

Herb Martin

Mike Lee said:
@echo off
for %%i in (%*) do exifiron -R -E -b %%i

The file is designed to rotate jpeg images using the program exifiron.
Anyway, the batch file will process an unlimited number of images at one
time, but when I compile the file into an executable it will only
process a maximum of two images. If I try to feed it more than two images
at a time it won't process anything. I've tried several different
compilers
and the results are always the same.

Which specific compilers are you using?

Will the compiled batch work if you change the command to merely
@echo the switches? (Is the problem in the do COMMAND or
in the FOR..IN..DO loop portion?)

If it works with a simple Echo, will it work for other "exe" command
besides your graphics program?
 
T

Todd Vargo

Mike Lee said:
@echo off
for %%i in (%*) do exifiron -R -E -b %%i

The file is designed to rotate jpeg images using the program exifiron.
Anyway, the batch file will process an unlimited number of images at one
time, but when I compile the file into an executable it will only
process a maximum of two images. If I try to feed it more than two images
at a time it won't process anything. I've tried several different compilers
and the results are always the same.

I've tried various changes suggested to me but nothing has worked to
eliminate this limitation.

Any help would be much appreciated.

Why compile the batch?

Anyway, have you tried shifting in a loop?

@echo off
:loop
if "%1"=="" goto :end
exifiron -R -E -b %1
shift
goto :loop
:end
 
G

Guest

Herb and Todd:

Thanks for your suggestions. If I make any changes the compiled program
won't run at all. I have tried both Quick Batch File Compiler and ExeScript
to compile the batch file. They are "consumer level" compilers, but that's
me. This is one of six little free tools I have developed to work with most
photo management programs. Of course I'd like to have them compiled so that
the cmd.exe box doesn't show at all (either resized or minimized), it also
simplifies installation. When I tried Todd's suggestion the program also
failed to execute as either a batch or executable, and for any number of
images. I am suspecting the compilers do not like something which would by
any other (batch command) standard seem correct. So I'm still working on
it...
Thanks again,
 
T

Todd Vargo

Mike said:
Herb and Todd:

Thanks for your suggestions. If I make any changes the compiled program
won't run at all. I have tried both Quick Batch File Compiler and ExeScript
to compile the batch file. They are "consumer level" compilers, but that's
me. This is one of six little free tools I have developed to work with most
photo management programs. Of course I'd like to have them compiled so that
the cmd.exe box doesn't show at all (either resized or minimized), it also
simplifies installation. When I tried Todd's suggestion the program also
failed to execute as either a batch or executable, and for any number of
images. I am suspecting the compilers do not like something which would by
any other (batch command) standard seem correct. So I'm still working on
it...
Thanks again,

You never indicated how many files are you dropping at once. That may be the
key factor to the problem. Perhaps the compiled program has a limitation on
input string. If all you want to do is eliminate the command window from
displaying, then an equivelent VBScript may be a better way to go.

' Rotate.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objArgs = WScript.Arguments

If objArgs.Count = 0 Then
MsgBox "Drop image files to rotate using EXIFIRON"
Wscript.Quit
End If

For i = 0 to objArgs.Count - 1
WshShell.Run "exifiron -R -E -b " & objArgs(i), 0, True
Next
 
T

Todd Vargo

Todd Vargo said:
Why compile the batch?

Anyway, have you tried shifting in a loop?

@echo off
:loop
if "%1"=="" goto :end
exifiron -R -E -b %1
shift
goto :loop
:end

Let's try this again. Does this one work? If not, try the VBScript in my
other post.

@echo off
:loop
if (%1)==() goto :end
exifiron -R -E -b %1
shift
goto :loop
:end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top