Compiled batch file won't execute properly

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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?
 
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
 
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,
 
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
 
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
 
Back
Top