Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to do something like below in Windows Command Prompt:

cd C:\MyFiles mkdir Files

What I'm trying to do is go into a specific folder using the cd command and then create a new folder using the mkdir command. I need to do this in one single command/line. This could be done by two separate commands, but I don't have this option.

share|improve this question
up vote 2 down vote accepted
cd /D C:\MyFiles & mkdir Files

Here's the documentation.

The /D parameter will also change the drive.

share|improve this answer
1  
Beat me to it by seconds. +1 :) – nc4pk Aug 4 '13 at 17:47
    
Thank you guys. – jorame Aug 4 '13 at 17:48
2  
cd /D C:\MyFiles & mkdir Files – Vlastimil Ovčáčík Aug 5 '13 at 16:33
2  
I definitely agree with @Vlastimil's modification. Leaving off the /D flag has bit me in the past. – Dominic P Aug 20 '13 at 21:41
    
@DominicP Right, that's much better. Thanks! – Igor Hatarist Aug 21 '13 at 3:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .