Caml Light Posted November 2, 2012 Share Posted November 2, 2012 (edited) Hi guys, if i do this:WIN+R -> cmd /k echo Hello -> ENTERWIN+R -> cmd /k echo World -> ENTERI'll have 2 different CMD shell windows: the first displays "Hello", while the second "World".Do you know if is it possible to launch the second command in the same CMD shell window of the first one, to have:HelloWorld_Thank you in advance Edited November 2, 2012 by Caml Light Link to comment Share on other sites More sharing options...
Guest Posted November 2, 2012 Share Posted November 2, 2012 You could use the ampersand (&) to pass more than one command per line.cmd /k echo Hello &echo World Link to comment Share on other sites More sharing options...
Caml Light Posted November 2, 2012 Author Share Posted November 2, 2012 Yes, that works launching a single instance of cmd.exe. But does exists a way to do exactly what i wrote? Link to comment Share on other sites More sharing options...
Guest Posted November 2, 2012 Share Posted November 2, 2012 If there is, I don't know it. Link to comment Share on other sites More sharing options...
jaclaz Posted November 2, 2012 Share Posted November 2, 2012 Yes, that works launching a single instance of cmd.exe. But does exists a way to do exactly what i wrote?I am failing to see the difference between what you initially asked and the result of what was suggested, can you try expanding on what you want to achieve? Additionally, I presume that your actual GOAL is NOT that of having one or more CMD.EXE windows echoing to screen "Hello World" , please do state the actual GOAL, there might be different ways to achieve that.Be aware of the risk of slipping on a chocolate covered banana :http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/put-down-the-chocolate-covered-banana.htmljaclaz Link to comment Share on other sites More sharing options...
Caml Light Posted November 2, 2012 Author Share Posted November 2, 2012 ok... i'll try to explain better:Imagine to have a CMD shell window already opened. Is it possible to pass it some commands, not writing them into that shell but from WIN+R? Link to comment Share on other sites More sharing options...
jaclaz Posted November 2, 2012 Share Posted November 2, 2012 ok... i'll try to explain better:Imagine to have a CMD shell window already opened. Is it possible to pass it some commands, not writing them into that shell but from WIN+R?Win+R simply opens the "Run" dialog/popup.In it you have to type some commands.You can use some tool (like Nircmd):http://www.nirsoft.net/utils/nircmd.html to set focus to the already active CMD window and paste/execute in it some command.This still seems completely unlike being a GOAL (or if it is a goal, it appears like a senseless one ).BTW, you seem like having a tradition of being reluctant in providing the actual scope of what you are asking for, posting instead "vague" or "generic" examples, which everytime need some back and forth rounds of questions to actually get what the actual question is about. (and hopefully provide an appropriate solution/answer/advice)jaclaz Link to comment Share on other sites More sharing options...
Caml Light Posted November 2, 2012 Author Share Posted November 2, 2012 Thank you jaclaz, the actual scope of my question is written in the previous posts. My GOAL is exactly it: To pass to an opened cmd shell some commands written from the "Run" prompt.Alternatively, instead to use the "Run" prompt, i also can use a cmd batch script that send commands to the opened cmd shell. If i run a common batch, it will open a new cmd shell window. Link to comment Share on other sites More sharing options...
Guest Posted November 2, 2012 Share Posted November 2, 2012 (edited) "Why?" or "To what end?" "What purpose..." does reusing a CMD window serve? Why not just include the command in a batch file?If you want to run a batch script within a batch script, you can always CALL it without opening a new CMD window. Edited November 2, 2012 by 5eraph Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now