RobertoFreemano
asked on
textbox to CMD.exe vb.net (2003)
Hi Experts,
I've created a little notepad clone... What I want to do is to be able to write the word - 'ping' followed by 'UNC' and on carriage return... launch CMD.exe and be able to ping that UNC. or to be able to highlight the word 'ping unc' and click a button which will do the same.
I've created the winform with a textbox and a button. It also has a process which launches CMD.exe. But haven't managed to get the selected text to populate cmd.
I've tried console.writeline(textbox1 .text)
console.Readline()
But didn't work :(
Any ideas?
Roberto
I may increase points as I'm sure i have a few tweaks to add...
I've created a little notepad clone... What I want to do is to be able to write the word - 'ping' followed by 'UNC' and on carriage return... launch CMD.exe and be able to ping that UNC. or to be able to highlight the word 'ping unc' and click a button which will do the same.
I've created the winform with a textbox and a button. It also has a process which launches CMD.exe. But haven't managed to get the selected text to populate cmd.
I've tried console.writeline(textbox1
console.Readline()
But didn't work :(
Any ideas?
Roberto
I may increase points as I'm sure i have a few tweaks to add...
https://www.experts-exchange.com/questions/21426246/keep-the-shell-window-open.html?query=shell+vb.net+dos&clearTAFilter=true
Take the line from the text box and pass it to CMD as indicated in the link.
Take the line from the text box and pass it to CMD as indicated in the link.
ASKER
Thanks cookre,
I will try that code out in a mo.
:)
I will try that code out in a mo.
:)
ASKER
Just to make myself a little clearer,
I'm aiming a producing a textbox in which I type in a specific string = "ping 192.168.0.1'... once i press spacebar, the string will become a link which if clicked, it would open a application like CMD.exe.
the word ping would have to be defind...
I'm aiming a producing a textbox in which I type in a specific string = "ping 192.168.0.1'... once i press spacebar, the string will become a link which if clicked, it would open a application like CMD.exe.
the word ping would have to be defind...
ASKER
Thanks Cookre,
That worked, But is there a way of repeating that once a carriage-return is entered in the textbox?
If I type <ping 192.168.0.1>: it opens cmd.exe and pings that address, GREAT... but once I close cmd.exe and type a new line> ping 172.68.5.1 in the textbox... it refers back to the top line of the textbox = <ping 192.168.0.1>
Any ideas?
Roberto
That worked, But is there a way of repeating that once a carriage-return is entered in the textbox?
If I type <ping 192.168.0.1>: it opens cmd.exe and pings that address, GREAT... but once I close cmd.exe and type a new line> ping 172.68.5.1 in the textbox... it refers back to the top line of the textbox = <ping 192.168.0.1>
Any ideas?
Roberto
Do a textbox.Clear() after running the command.
ASKER
Hi Cookre,
That will clear the entire contents of the textbox... sorry, I should have mentioned that the textbox is multilined as I want to continue typing into it.
Is this possible?
Roberto
That will clear the entire contents of the textbox... sorry, I should have mentioned that the textbox is multilined as I want to continue typing into it.
Is this possible?
Roberto
ASKER
Also, is there a way keeping the CMD.exe shell open whilst going back to my form...
It seems to egg-timer on the form until the Shell is closed.
Regards,
Roberto
It seems to egg-timer on the form until the Shell is closed.
Regards,
Roberto
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
:)