Good one mate! We could do with more of such shorties!
Cheers!
AN
Discussion on:
View:
Show:
If you need to create c:\one\two\three you can do it in one command as well with
md c:\one\two\three
It doesn't matter if any or all of the branch doesn't exist - all will be created in the correct order.
Jim
"If you think the problem is bad now, wait until we fix it!"
md c:\one\two\three
It doesn't matter if any or all of the branch doesn't exist - all will be created in the correct order.
Jim
"If you think the problem is bad now, wait until we fix it!"
you can also removes multiple folders too using the RD command as follows:
rd %1 %2 %3 where the %1= the folder you wished to remove
rd %1 %2 %3 where the %1= the folder you wished to remove
The Remove Directory command works the same way.
RD TEST1 TEST2 TEST3 will delete the folders test1 test2 and test3 and if there files in the folders you can use the RD /S Test1 Test2 and you will be prompted are you sure for each folder that was being deleted.
RD TEST1 TEST2 TEST3 will delete the folders test1 test2 and test3 and if there files in the folders you can use the RD /S Test1 Test2 and you will be prompted are you sure for each folder that was being deleted.
I think that what seperates alot of techs.I know so many techs that have no idea how to do any dos commands or anything on command line.I know its kinda dead but it still has it uses.
Hey Eric,
I am a tech, and You are wrong. I don't know what techs you know or are talking about, but the in my tech Class, everyone was required to know the common DOS commands. I find it vital to use DOS when it comes to troubleshooting a system from the PROMPT.
I am a tech, and You are wrong. I don't know what techs you know or are talking about, but the in my tech Class, everyone was required to know the common DOS commands. I find it vital to use DOS when it comes to troubleshooting a system from the PROMPT.
so what if i want to make a bunch of folders, with a bunch of teh same subfolders ie.
in a list I have
test1
test2
test3
but I want the file to make
test1\sub1
test1\sub2
test1\sub3
test2\sub1
test2\sub2
test2\sub3
thanks so much!
in a list I have
test1
test2
test3
but I want the file to make
test1\sub1
test1\sub2
test1\sub3
test2\sub1
test2\sub2
test2\sub3
thanks so much!
so what if i want to make a bunch of folders, with a bunch of teh same subfolders also what if you want to have the spaces ie.
in a list I have
test 1
test 2
test 3
but I want the file to make
test 1\sub 1
test 1\sub 2
test 1\sub 3
test 2\sub 1
test 2\sub 2
test 2\sub 3
thanks so much!
in a list I have
test 1
test 2
test 3
but I want the file to make
test 1\sub 1
test 1\sub 2
test 1\sub 3
test 2\sub 1
test 2\sub 2
test 2\sub 3
thanks so much!
To create a series of folders/sub-folders, just type the path.
Example:
MD C:\test1\sub1
If you want to add multiple folder branches, just separate the paths with a space.
Example:
MD C:\test2\sub2 C:\test3\sub3
Example:
MD C:\test1\sub1
If you want to add multiple folder branches, just separate the paths with a space.
Example:
MD C:\test2\sub2 C:\test3\sub3
Jessica, there is a easier way making your sub-folders, especially when it is redundant.
A simple batch file can be used to make it from the Directory you are in;also this can be done from the prompt.
for test 2\sub 1 ... [ see below]
Below this batch file creates two folders and three sub-folders inside each folder.
-------
:: Two Colons allow for A comment just like using REM
:: Place this batch file in the folder where
:: you want to create the folders.
:: Change to code page 1252
chcp 1252
:: if spaces are used then enclose folder name in double quotes
:: Folder names can be separate by a Space,
:: coma or Semi-colon
:: Start batch file
md "Test 1" "Test 2"
cd "Test1
md sub1 sub2 sub3
cd ..
cd "Test 2"
MD sub1 sub2 Sub3
cd ..
:End
----
What's is nice about DOS, one can create a folder starting with a period(dot). Windows won't allow this in Explorer.
Example.
md ".Net"
Also
MD "..Audio"
works too.
however, If this was on a FLash Drive and you were running Unbuntu (Linux) DotFolders Don't show up and you will be in a bit of a jam;that is why it is best to put dotNET for the name of your folder. Or one can put this :
md "??.Net"
Of course Windows doesn't allow Spaces, but if you copy my example it should work. If you want to get by Windows using a Dot and Not having problems later access the folder from LINUX type systems, then use the ALT 0160, sequence to make a space. This Space works in DOS by holding the ALT key and on the numberpad, typing in 0160. I am not a batch file wizard, but I do know how to do some things in DOS.
So you would type MD, Spacebar, Double Quote, Alt 0160, period, NET, Double Quote" all on one line in DOS or in NOTEPAD if for a BAT(ch) file. 'Alt 0160' can be done also in the Explorer (File Manager) when creating folders too, thus getting around creating a Folder with a period inside Windows.
I don't know everything about batch files, but if someone needs a bit of help, just ask ..
A simple batch file can be used to make it from the Directory you are in;also this can be done from the prompt.
for test 2\sub 1 ... [ see below]
Below this batch file creates two folders and three sub-folders inside each folder.
-------
:: Two Colons allow for A comment just like using REM
:: Place this batch file in the folder where
:: you want to create the folders.
:: Change to code page 1252
chcp 1252
:: if spaces are used then enclose folder name in double quotes
:: Folder names can be separate by a Space,
:: coma or Semi-colon
:: Start batch file
md "Test 1" "Test 2"
cd "Test1
md sub1 sub2 sub3
cd ..
cd "Test 2"
MD sub1 sub2 Sub3
cd ..
:End
----
What's is nice about DOS, one can create a folder starting with a period(dot). Windows won't allow this in Explorer.
Example.
md ".Net"
Also
MD "..Audio"
works too.
however, If this was on a FLash Drive and you were running Unbuntu (Linux) DotFolders Don't show up and you will be in a bit of a jam;that is why it is best to put dotNET for the name of your folder. Or one can put this :
md "??.Net"
Of course Windows doesn't allow Spaces, but if you copy my example it should work. If you want to get by Windows using a Dot and Not having problems later access the folder from LINUX type systems, then use the ALT 0160, sequence to make a space. This Space works in DOS by holding the ALT key and on the numberpad, typing in 0160. I am not a batch file wizard, but I do know how to do some things in DOS.
So you would type MD, Spacebar, Double Quote, Alt 0160, period, NET, Double Quote" all on one line in DOS or in NOTEPAD if for a BAT(ch) file. 'Alt 0160' can be done also in the Explorer (File Manager) when creating folders too, thus getting around creating a Folder with a period inside Windows.
I don't know everything about batch files, but if someone needs a bit of help, just ask ..
RD works as well to remove empty directories.
SHIFT-TAB reverses the order.
Both TAB and SHIFT-TAB loop endlessly.
Can it be that I actually MISS the odd DOS exercise!!??
SHIFT-TAB reverses the order.
Both TAB and SHIFT-TAB loop endlessly.
Can it be that I actually MISS the odd DOS exercise!!??
Multiple targets to a command - sure looks like unix to me. MSDOS (from 2.0 thru Win98) complains of too many parameters when you try that. Microsoft finally is starting to catch up on command line commands that they have been trying so hard to make people forget about.
I have often said the only thing that could kill Unix is the "Microsoft distribution of Linux"
Is there a way to open a command prompt within a folder without manually editing the registry to add a context menu item?
Microsoft KB article # 320148 outlines the procedure for editing the registry, but I want to know if there's an easier solution...
I checked Tweak UI and it doesn't have this capability, are there any other free utilities that will do this?
Microsoft KB article # 320148 outlines the procedure for editing the registry, but I want to know if there's an easier solution...
I checked Tweak UI and it doesn't have this capability, are there any other free utilities that will do this?
There is a way to open a command prompt from the folder you are in with a tool from microsoft's powertoy. Called cmdhere.inf, it adds a line in the dialog box when you right click to open a "cmd prompt here". Search microsoft.com site for powertoy and then search for cmdhere.
Thank You for the reply, I'll get the powertoy from microsoft.
..that'll be a lot easier than regedit.
This thread was so old, I was afraid no one would see my question.
Thanks again for taking the time to answer.
..that'll be a lot easier than regedit.
This thread was so old, I was afraid no one would see my question.
Thanks again for taking the time to answer.
Try this: (excerpt from PowerToys read me)
Toys released for Windows XP Client:
Open Command Window Here
This PowerToy adds an "Open Command Window Here" context menu option on file system folders. This gives users a quick way to open a command window (cmd.exe) pointing at the selected folder. After installation, right click on the folder you would like to have a quick launch command window for and select "Open Command Window Here."
Now can we open a Window in a command line multiple options action to navigate more easily? Sure, just can't remember which ones just now but wish it would have existed for MSDEX way back when. Steve
Toys released for Windows XP Client:
Open Command Window Here
This PowerToy adds an "Open Command Window Here" context menu option on file system folders. This gives users a quick way to open a command window (cmd.exe) pointing at the selected folder. After installation, right click on the folder you would like to have a quick launch command window for and select "Open Command Window Here."
Now can we open a Window in a command line multiple options action to navigate more easily? Sure, just can't remember which ones just now but wish it would have existed for MSDEX way back when. Steve
Actually the MS Powertoy for the command prompt is a Registry edit.
I need to create couple hundred folders I have a list of the folders in a text file. MD however doesn't take the input from a file. I had to name a copy of the txt to bat, and append md to the start of the file,and it worked. Remember to use qoutes to create folder with spaces in them
It's been an interesting read thru all these
comments - and really refreshing to note that
DOS is still alive and well!
Afraid am a bit late stumbling onto this thread.
Just wondering if someone can spell out for me
a simple way to re-implement the old DOS
"command/y/c" command, which Big Brother seems
to have killed for the usual perverted reasons.
In any case, as we all know, it doesn't work in
Win XP Pro. I understand there's a way via 'set'
but things looked overly complicated to me when I first laid eyes on it and my poor old brain shelved it at the time. Now can't recollect.
Any of you DOS Guru's out there able to assist?
Appreciate,
Jed...
comments - and really refreshing to note that
DOS is still alive and well!
Afraid am a bit late stumbling onto this thread.
Just wondering if someone can spell out for me
a simple way to re-implement the old DOS
"command/y/c" command, which Big Brother seems
to have killed for the usual perverted reasons.
In any case, as we all know, it doesn't work in
Win XP Pro. I understand there's a way via 'set'
but things looked overly complicated to me when I first laid eyes on it and my poor old brain shelved it at the time. Now can't recollect.
Any of you DOS Guru's out there able to assist?
Appreciate,
Jed...
CMD supports long names and lots of clever bits, and is way more versatile than COMMAND. Check out CMD /? ... and FOR /?
So:
Make the file extension of your input file ".bat"
CMD/C will step through each line and execute whatever that lines says to do, then go to the next and exit at the end of the input file. No need for the /Y anymore.
So: If my input file, called INPUT.BAT say, looks like this:
@echo off
md "c:\test 1"
md "c:\test 2"
I can run: CMD/C input.bat and it will make those folders in the specified path. The quotes are needed if you want spaces in the names by the way.
OR: As in an earlier post if I need to make 1000 folders say, one per user or something I can use a FOR loop.
I would have a text file called "userlist.txt" with each name on a new line. Then just with one command I can make a folder for each one thus:
FOR /F %1 IN (userlist.txt) do MD (%1)
The FOR /F command take the first line of the input file as the parameter to pass to the MD command, then it will loop to the next line and so on till the end of the input file.
Command lines ... ah the power !
MB
So:
Make the file extension of your input file ".bat"
CMD/C will step through each line and execute whatever that lines says to do, then go to the next and exit at the end of the input file. No need for the /Y anymore.
So: If my input file, called INPUT.BAT say, looks like this:
@echo off
md "c:\test 1"
md "c:\test 2"
I can run: CMD/C input.bat and it will make those folders in the specified path. The quotes are needed if you want spaces in the names by the way.
OR: As in an earlier post if I need to make 1000 folders say, one per user or something I can use a FOR loop.
I would have a text file called "userlist.txt" with each name on a new line. Then just with one command I can make a folder for each one thus:
FOR /F %1 IN (userlist.txt) do MD (%1)
The FOR /F command take the first line of the input file as the parameter to pass to the MD command, then it will loop to the next line and so on till the end of the input file.
Command lines ... ah the power !
MB
tried the command FOR /F %1 IN (userlist.txt) do MD (%1)and nothing happened, i didnt even get an error message
The interesting thing is, that you can do this:
C:\temp\t>dir czr*
Volume in drive C has no label.
Volume Serial Number is 5CC0-9DEE
Directory of C:\temp\t
28.11.2007 18:01 czrm1
28.11.2007 18:01 rd /s /q czr*
The filename, directory name, or volume label syntax is incorrect.
you get a stupid error... Why RD just does not support wildcards?
C:\temp\t>dir czr*
Volume in drive C has no label.
Volume Serial Number is 5CC0-9DEE
Directory of C:\temp\t
28.11.2007 18:01 czrm1
28.11.2007 18:01 rd /s /q czr*
The filename, directory name, or volume label syntax is incorrect.
you get a stupid error... Why RD just does not support wildcards?
After spending 45 minutes looking for a PowerShell script to do the without sucess I ran into this post. I guess sometimes you have to go back to the basics to find the best tool for the job. Thanks
hi this is adnan here,
if you want to creat a folder in cmd you will easy creat . firstly start menue+run+cmd or ok and if you have black screen of command prompt alt+enter you screen will be full screen now ... enter cd\ enter
then enter dir enter and creat folder for enter md space name and enter and again dir enter
if you want to creat a folder in cmd you will easy creat . firstly start menue+run+cmd or ok and if you have black screen of command prompt alt+enter you screen will be full screen now ... enter cd\ enter
then enter dir enter and creat folder for enter md space name and enter and again dir enter
- Keyboard Shortcuts:
- Prev
- Next
- Toggle









































