1.

Solve : command prompt help?

Answer»

Hi...

I want to run a multistep process on command line but without user's input. I want this input to come from a batch file. How can i do that? I am trying to automate this process




ex:
c:\>Hello how are you?
user: fine ----------------------->-----------
write a number | ------> to come from batch file sequentially
user : 4 --------------------->-----------

I want command line to take input from batch file


thanks
Not sure I understand your question.

Do you have anything to show us?What i simply want is -- User shouldnot enter anything from standard input and the input should come automatically to the command prompt.So you want to MAKE a batch file, right?

Something like this?

Code: [Select]echo How are you?
echo Fine
pause
or do you want the batch file to interact with another CMD Window?Code: [Select]echo.Hello how are you?
set /p answ=
echo.user: %answ%

echo.write a number
set /p answ=
echo.user : %answ%
set /p allow user to input text and save it to variableQuote from: devcom on August 13, 2008, 03:21:43 AM

Code: [Select]echo.Hello how are you?
set /p answ=
echo.user: %answ%

echo.write a number
set /p answ=
echo.user : %answ%
set /p allow user to input text and save it to variable
Yeah but he said he didn't want the user to input anything Thanks for the prompt replies...


You are right Carbon Dudeoxide --->

----- "I want the batch file to interact with CMD Window?-----
I think I am starting to get a vague idea of what you want.....

So you start a batch file, it will ask 'How Are You?' and you want it to automatically reply and say 'fine'?

Lol, is it just me or is anyone else getting confused? Actualy i m implenting a code from java which EXECUTES on command prompt but cmd prompt hangs and waits for an answer.. i want this answer to automatically reach cmd prompt..... any way HW can i do that....Anything you can show us or give an example?jsut an example for what i mean.....

In Java :

Process p = runtime.exec("cmd /c start xcopy c:\abc.txt c:\bin /m);


at cmd prompt:

c:\>xcopy c:\abc.txt c:\bin /m
Does C:\bin specify a file name
or DIRECTORY name on the target
(F = file, D = directory)? _


--- here cmd prompt expects an input which I want to come automatically
Quote from: MAKT on August 13, 2008, 04:55:11 AM
Thanks for the prompt replies...


You are right Carbon Dudeoxide --->

----- "I want the batch file to interact with CMD Window?-----


lol, i didnt read it carefully


Discussion

No Comment Found