Dos exe with no command line arguments - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Dos exe with no command line arguments

Monty1Monty1 Posts: 1Member
I'm running a dos exe file which requires 3 inputs, but does not have any command line switches to allow me run the command from single line.

This is what happens currently:
....running.....enter version 1, 2 or 3: [color=Blue]3[/color]
....running.....enter input file path: [color=Blue]c: est1[/color]
....running.....enter output file path: [color=Blue]c: est1R[/color]
COMPLETE! Press enter to continue..
(where I need to enter "[color=Blue]decode.exe[/color]", "[color=Blue]3[/color]", "[color=Blue]c: est1[/color]" and "[color=Blue]c: est1R[/color]" as seperate inputs)

Ideally, I would like to use something like:
c:>[color=Blue]decode.exe 3 c: est1 c: est1R[/color]
But this will ignore the additional fields and wait for the version.

I have tried pasting from notepad into the command window. This works, but the buffer will only allow about 5 lines and I need to run about 500!

I have also tried using batch file to run one line after another, but the session hangs waiting for the response to the version question.

Any help would be appreciated.


  • iyercbiyercb Posts: 5Member
    It is quite possible that the program is written in such a way that it prompts for input after each step. In this case, there is not much you can do.

    Anyway try this bat file

    rem @echo off
    rem calling protocol: ExecuteDecode.bat version inputfilepath outputfilepath
    IF "%1" == "" GOTO ErrorNoVersion
    IF "%2" == "" GOTO ErrorNoInputFilePath
    IF "%3" == "" GOTO ErrorNoOutputFilePath
    echo Executing Decode
    decode %1 %2 %3
    goto Exit
    echo You did not enter an Output File Path
    goto Exit
    echo You did not enter an Input File Path
    goto Exit
    echo You did not enter a Version
Sign In or Register to comment.