GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
<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
Last edited by unimaginative; 01-02-2004 at 10:49 AM.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.