Getting command prompt result into textbox

  • Thread starter Thread starter kimiraikkonen
  • Start date Start date
K

kimiraikkonen

Hello,
I have a textbox named "textbox1" and a button named "button1"

How can i retrieve the console (cmd) data into textbox?

For example when i run Shell("cmd.exe /k dir c:\",AppWinStyle.Hide)
when pressed button1, i want the result is displayed into textbox.

Thanks
 
instead of using shell use the process class

then

p.Start
dim reader as streamreader = p.standardoutput
p.waitforexit
messagebox.show(reader.readtoend)

hth

Michel
 
Set it as parameters in your constructor and use the values.

Cor

"kimiraikkonen" <[email protected]> schreef in bericht






- Show quoted text -

Could you define more?

I'm newbie. When i use system.process.diagnostics.start("cmd.exe /k
dir c:"), i get "cannot find specified file" error while debuggin. If
i use Shell("cmd.exe /k dir c:\",AppWinStyle.Hide), no problems for
running, but i cannot get the results as texts into my textbox.
 
instead of using shell use the process class

then

p.Start
dim reader as streamreader = p.standardoutput
p.waitforexit
messagebox.show(reader.readtoend)

hth

Michel

"kimiraikkonen" <[email protected]> schreef in bericht






- Show quoted text -

Did it but got error : "standard output has not been redirected"
 
Back
Top