Hello everyone
I've been searching for help for a long time and still can't find somebody to solve it for me :(, The problem is im not good at explaining it , But here is the problem
I'm creating an application in visual basic 2010, and i was aiming to use the The windows command "cmd" inside of the application that im creating in vb, For example, If i wanted to use the cmd on windows, i can go to start menu+search "cmd" and then start using it, But what i wanted it is instead of having to go to start menu........., i wanted to have in inside my application and i was wondering if any body could help me get that work, By the way, i'm not a pro programmer, But i can understand the basic of visual basic 2008/2010
If any body could help, please give a little bit of your time if could and help me figure it out
If you are not sure about what i meant for having cmd inside the vb app, Please let me know and i will try with all what i can to make it a little bit more clear
Thank you so much :)

Recommended Answers

All 6 Replies

I attached a sample project that implements a command shell inside a Windows form. I hope this helps.

Hello Reverend Jim
Thank you so much for your quick reply and help
That what exactly what i wanted it it's working fine , god bless you mate xxx

Hello Reverend jim
I have got some few more question if you could help me please
1) How can i remove this from the command>> Process Started at: 04/11/2012 00:11:50
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
2) is there any way to run multi CMD?
thanks for your help, And i hope to hear from you again thanks

No way that I know of to suppress the header but the " Process Started at: 04/11/2012 00:11:50" can be removed by removing the last line of Form_Load, to wit

AppendStdOut("Process Started at: " & MyProcess.StartTime.ToString)

If you mean multiple concurrent commands then you'd have to create a separate process for each one. If you mean consecutive then submit the commands one after another or all at once using & as a separator as in

dir d:\ & copy file1.txt file2.txt & del file1.txt

Thanks for your replies as always
But im sorry i didn't understand this line
dir d:\ & copy file1.txt file2.txt & del file1.txt

If you were to type that into a command shell it would run the three commands

dir d:\
copy file1.txt file2.txt
del file1.txt

one after the other. The & allows you to enter more than one line at a time. It's like you were saying "do a DIR and a COPY and a DEL"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.