How to change directories in DOS
Hello, i know it is dangerous to ask such questions on a Linux forum, but i need help and i'm sure here is the right address to get it, besides DOS was not MS invention! :)
How to change directories in DOS, if the names of directories contain spaces, e.g.: my documents; cd my documents doesn't work. I've tried using commands using backslashes, brackets, slashes, cornered brackets, {},<>, quotation marks nothing works. Has somebody any idea how to fix the problem? |
Try:
cd "my documents" or whatever the dir is. If you need to move several directories, try: cd "my documents\games\Gamefolder with spaces" |
This might help.
http://www.computerhope.com/msdos.htm#02 |
Try 'cd "My Documents" ' or 'cd [whatever the dos truncated form is]'. 'Dir' shows the truncated form along with the long one.
|
Wow, you have all been suffering too much exposeur to Linux :)
I believe he's looking for "cd My Docum~/games/ Games with~/" or something similar, there is a character limit that is valid in DOS, I'm not sure what it is though. |
Exactly - DOS doesn't allow spaces in names. DOS is limited to 8.3 and, when converting from windows, collapses and capitalizes the first 6 characters, adds a '~1' or what have you (to prevent clobbering), and truncates extensions to 3. (The capitalization isn't important, as DOS isn't case-sensitive but just to explain the display - everything in DOS is caps to DOS.) So
C:\My Documents\cool.game becomes C:\MYDOCU~1\COOL.GAM and that's what you type. In Windows in a DOS box (DOS 7x or the NT emulation or whatever it is), you can use that or the quotes, as XavierP said, or even blackslash escapes, I think. |
to change from one drive to the other, you don't need cd.
just type (example) C:\>D: titanium_geek |
thank you guys, but nothing worked. let's say i the name of my direcotry is a b (a space b). how to change it from c:\? nothing worked -> that with my documents works on folder name my documents, but im this case (folder a b) not.
|
If the folder is in c: (ie C:\a b) then you should type: cd "a b" assuming you are in the root of c.
If you are in My Documents and need to get to c:\a b then you should type in "cd .." (w/o the quotes) until you get back to c:, then do cd "a b". In Windows you have to be 'above' the folder you need to be able to get to it. Or type in the full path: cd c:\foldername\foldername\foldername\a b. |
omg!
<sarcasm> you damn well careful mister! how could you invoke the name of M$ omg!111111111!11111111!!!!!!!!!!!!!!!!!!!!!!11. Invoking the name of M$ is racist, bigotted, and xenophobic!!! You have to burn everything from m$ to be a true 1337 linux user. Down with the eveil empire1111111!!!!!!!!!1111111!!!!!!!!!!!!!!!!!!!<sarcasm>
p.s. if you want to be a mindless 1337 sheep in the linux flock, always always spell Microsoft with a dollar sign |
We may invoke the Name of the Beast (of Redmond). Surely we all have l33t circles of divine protection?
In the name of Torvalds and of Stallman and of Cox, amen. :D |
beast of redmond, lol
|
there are a couple of special cases
first of all, you could use the command chdir instead of cd, but it is pointless extra typing if you are using win9x there is likely to be a tilde and a number next to the name eg. C:\progra~1 = C:\Program Files enter the command "dir" to see what the name is secondly, if you are changing directories in to a directory that has a space you could type C:\"Program Files" or C:\Program/ Files You can also just type A: B: C: D: E: or F: as mentioned above to switch to a device in dos you do not have to omit the space between commands e.g. cd.. will work the same as cd .. keep in mind that directories in dos are backspaces |
Yes, CD is just a shortened form of CHDIR in DOS and Windows. Anyway, if you want to get to the folder "C:\a b", then you can just type:
CD "C:\a b" Keep in mind that COMMAND.COM and CMD.EXE are usually smart enough not even to need to escape the spaces or put them in quotes, at least under Windows. However, if you're using Windows 95 or Windows 98, you probably will need to put the directory name in quotes if it doesn't follow the 8.3 format if you're in MS-DOS mode (not just an MS-DOS prompt in Windows). If you've booted into MS-DOS 6.22 or older and you're accessing a partition with extended filenames (VFAT), you'll have to follow the C:\PROGRA~1 instead of "C:\Program Files" convention. By the way, using VFAT and NTFS under Linux is similar: cd "/winmnt/Documents and Settings/User/My Documents" where /winmnt is where the VFAT or NTFS partition is mounted in the Linux filesystem. |
Are you using a DOS prompt in windows, or are you using "the real DOS" (No Windows installed)
If your at a DOS prompt under a windows intallition, what version of windows is it? XP, 98, 95 |
All times are GMT -5. The time now is 02:33 PM. |