Search This Blog

Wednesday, April 25, 2012

How to execute multiple command in DOS or Command prompt

Hello guys here I am again to share some knowledge that I have learn to my fellow programmers.

Usually we use to execute command in the DOS or command line using per line of command like the example below

cd\  - goto root path or directory
cd Test - goto Test folder inside the root path or directory
Looks simple but how about if we want to execute this command in just one line? Seems hard but it's not. With the use of ampersand we can execute the above 2 command with just one line. Below is the example on how do it.

cd\   & cd Test 

With the use of ampersand we manage to execute this command to the DOS or command prompt in just one line.

Ok thats it again guys, this may seems not a good topic but like me I thought I may not be doing this command file scripting yet there are still some scenario wherein you as a developer or programmer need do this or run this bat file command.

Thanks for reading guys.


1 comment:

  1. Hello!

    I am a total newbie in programming in VB. I was doing a research for my project. I found your video: http://www.youtube.com/watch?v=Z-3WnBapJWo&feature=related

    It is very helpful.

    How should I modify this code to get it work like this:

    Textbox and it's function remains the same. I want to add a button that initiates the search function.

    Then remove the datagrid view and replace it with a Label which displays only the "Full name" when "ID" is entered to textbox and button is clicked. Could you help me with this, I really, really need this.

    Thank you in advance.

    ReplyDelete