PDA

View Full Version : Nested Cmd Sessions


jaywhy13
02-22-2006, 02:23 PM
Is it possible to from the command prompt in w2k to start a "cmd" and send arguments to it?

SpirtOfGrandeur
02-22-2006, 05:31 PM
Why would you want to send commands to it?

What could you possibly want to control in the cmd?

What are you using this for, I am sure there are at least 100 better ways to do it other then the way you are planning.

And for the general answer, Yes you can! (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/Cmd.mspx)

*Edit* Yes I know that says windowsXP but most of them work in windows 2ooo also.

jaywhy13
03-05-2006, 08:31 PM
Ok... I was tryin to generalize the question so that I didn't have to get down into the nitty gritty of the problem that I was having... Ok...
I am writing this Java app, that is more than likely going to use the process method of the System class or something of that sort. It can invoke command line options, that's the bottom line. Whatever I send as input to this method, is the same thing that I can type on da cmd line.

Now the problem is, I am opening a program that runs in dos. When the program starts... it connects to a remote machine, prints out som crap then returns to me the cmd shell of the remote machine where I can type away as if I was sitting at the remote comp typin in dos.

The problem is that when I call the program, I loose control after that... and whatever subsequent commands are in the batch file are executed AFTER the program is done running... I need a way around that. I need to communicate with the program while its running