Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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 :) –  tapped-out Aug 4 '13 at 17:47
    
Thank you guys. –  jorame Aug 4 '13 at 17:48
1  
cd /D C:\MyFiles & mkdir Files –  Vlastimil Ovčáčík Aug 5 '13 at 16:33
1  
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! –  IOXenus Aug 21 '13 at 3:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.