MS-DOS

Moderators: blip
Number of threads: 389
Number of posts: 904

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Dos exe with no command line arguments Posted by Monty1 on 13 Jan 2009 at 8:50 AM
Hi,
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:
c:\>decode.exe
....running.....enter version 1, 2 or 3: 3
....running.....enter input file path: c:\test1
....running.....enter output file path: c:\test1R
COMPLETE! Press enter to continue..
c:\>
(where I need to enter "decode.exe", "3", "c:\test1" and "c:\test1R" as seperate inputs)

Ideally, I would like to use something like:
c:\>decode.exe 3 c:\test1 c:\test1R
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.
Thanks.

Report
Re: Dos exe with no command line arguments Posted by iyercb on 22 Jan 2009 at 10:33 AM
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
:Start
IF "%1" == "" GOTO ErrorNoVersion
IF "%2" == "" GOTO ErrorNoInputFilePath
IF "%3" == "" GOTO ErrorNoOutputFilePath
echo Executing Decode
decode %1 %2 %3
pause
goto Exit
:ErrorNoOutputFilePath
echo You did not enter an Output File Path
pause
goto Exit
:ErrorNoInputFilePath
echo You did not enter an Input File Path
pause
goto Exit
:ErrorNoVersion
echo You did not enter a Version
pause
:Exit



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.