Announcement

Collapse
No announcement yet.

Batch execution using .bat file fails

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Batch execution using .bat file fails

    If I run this command explicitly at the command line it works fine:

    C:\Program Files\IrfanView>"C:\Program Files\IrfanView\i_view32.exe" "C:\temp\tif\2703767_1216.tif" /convert="C:\temp\tif\2703767_1216.tif.jpg" /ini="c:\temp\irfanview\"


    But if I place the same command into a .bat file nothing happens. No error is thrown. The batch file executes at the command line, but the output jpeg is not created.

    My .ini file is OK since the operation works if I type out the command at the command prompt and run it. I also tried removing that option from the .bat file and still no output is created by IrfanView.

    Is there something using a .bat batch method that I am missing?

    Thanks,
    Jeff

    #2
    I have not had time to look at this in any depth but I suspect it is connected with the quotes you are using. You probably do need them around "C:Program Files\Irfanview\i_view32.exe" which is the Command part but I do not think you need any quotes in the remainder which is just passed to Irfanview as Arguments.

    However if it works in a Command prompt (which uses Cmd.exe) then I would try renaming your batch file as *.cmd instead of *.bat
    I am not sure how a .bat file is handled by Windows these days. At one time they were handled by a DOS emulator to maintain compatibility with DOS and early editions of Windows. That could result in a result that differs from the Command Prompt.

    Comment


      #3
      Simple batch files still work on my Windows 7 system, like this one (USB stick, portable TCMD):

      @echo off
      cls
      cd\totalcmd
      totalcmd.exe
      J.A.G.

      Comment


        #4
        I have now tried your batch file (as a .bat) in Vista and it works fine. Sorry, I do not have Windows 7.
        You did remember to remove the prompt C:\Program Files\IrfanView> from the start of the line before you put it into the batch file, didn't you?

        Comment

        Working...
        X