473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Getting command prompt result into textbox

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

Sep 27 '07 #1
5 4048
Set it as parameters in your constructor and use the values.

Cor

"kimiraikkonen" <ki*************@gmail.comschreef in bericht
news:11*********************@r29g2000hsg.googlegro ups.com...
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
Sep 28 '07 #2

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" <ki*************@gmail.comschreef in bericht
news:11*********************@r29g2000hsg.googlegro ups.com...
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

Sep 28 '07 #3
"kimiraikkonen" <ki*************@gmail.comschrieb:
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.
<URL:http://dotnet.mvps.org/dotnet/samples/misc/RedirectConsole.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Sep 29 '07 #4
On Sep 28, 6:35 am, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Set it as parameters in your constructor and use the values.

Cor

"kimiraikkonen" <kimiraikkone...@gmail.comschreef in berichtnews:11*********************@r29g2000hsg.go oglegroups.com...
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- Hide quoted text -

- 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.

Sep 30 '07 #5
On Sep 28, 8:16 am, "Michel Posseth [MCP]" <M...@posseth.comwrote:
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" <kimiraikkone...@gmail.comschreef in berichtnews:11*********************@r29g2000hsg.go oglegroups.com...
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- Hide quoted text -

- Show quoted text -
Did it but got error : "standard output has not been redirected"

Oct 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Steve | last post by:
Is there anyone with experience using the Winzip command line add-in? I can't get it to create the zip file with a space in the file name. Using: RetValue = Shell("C:\winzip\wzzip.exe...
1
by: thomas goodwin | last post by:
Hi, This is a bit long explanation to what is probably a very easy problem: I have query 1: "Select col1 from table 1" I have form1 with: - a textbox for col1 - recordsource for form1 =...
2
by: Luis | last post by:
Hello, I want to start an application writen in VB.net by a commmand prompt. This application will put on a textbox one string (string1) and in another textbox another string (string2). The...
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
2
by: bkunjitam | last post by:
I am invoking a cygwin session by the following code from win32com.client import * a = Dispatch("Wscript.Shell") a.Run("C:/cygwin/cygwin.bat"); a.SendKeys ("cd D:/temp/code" +...
1
by: jweiss | last post by:
I am trying to run cmd.exe so that I can ftp a file to a remote server. I've been doing this for a long time, but something broke. I did some windows updates last week?? I am getting a...
3
by: kimiraikkonen | last post by:
Hi experts, I just want to ask a simple procedure of my simple form. My form has a input textbox and a button. I want this if you can help me: Application user types a command prompt command...
1
by: pramodkh | last post by:
Dear All, I am writting a PERL script in windows to test some test cases. The test result is captured both in command prompt and in the log file. But when the result is displayed on a windows...
2
by: aditi1184 | last post by:
Hi, I am trying to use the 'find' command of twill from within a python code but it seems to return no result. I tried to run that command on the command prompt by running twill and it works fine....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.