Solved Cannot change directory (CD) to a directory with space in the name

utnatw7f387

New member
Local time
7:27 PM
Messages
5
Following the directions outlined in http://www.sevenforums.com/general-discussion/144154-change-directory-command-prompt.html including enabling command extensions outlined in http://www.sevenforums.com/general-discussion/41993-command-line.html does not permit the CD command to change the directory focus to a directory with a space in its name. I am trying to set the active directory prompt to C:\Users\Owner\My Documents. I can get to C:\Users\Owner but with command extensions enabled in administrator mode (CMD E:ON) the CD command will not accept My Documents as a valid directory name within Owner. The error I get is "The system cannot find the path specified." My goal is to get a directory tree (as a file) of the directories and files in My Documents with the DIR command when in that directory. The complete DOS line for that command would read C:\Users\Owner\My Documents>DIR /o:n /s > DirTreeList.txt. Any help would be greatly appreciated.
 
Last edited by a moderator:

My Computer My Computer

At a glance

Windows 7 Pro x64Intel Core i7M620 2.67 GHz4 GB
Computer type
Laptop
Computer Manufacturer/Model Number
MSI MS-1733
OS
Windows 7 Pro x64
CPU
Intel Core i7M620 2.67 GHz
Motherboard
MSI MS-1733 Ver.001
Memory
4 GB
Hard Drives
2 x 320GB
Antivirus
ESET NOD32
Browser
IE 8
Welcome to Seven Forums utnatw7f387. I'm far from an expert, but will throw out something simple until the smart people see this. have you tried

C:\Users\Owner\My\ Documents>DIR /o:n /s > DirTreeList.txt

A Guy
 

My Computer My Computer

At a glance

Windows 10 Home x64INTEL Core i5-750 Quad-Core 3.37GHzHyperX Fury Black Series 8GB (2 x 4GB) 1866MhzEVGA GeForce GTX 750 Superclocked 1GB 128-Bit...
Computer type
PC/Desktop
OS
Windows 10 Home x64
CPU
INTEL Core i5-750 Quad-Core 3.37GHz
Motherboard
ASUS P7P55D
Memory
HyperX Fury Black Series 8GB (2 x 4GB) 1866Mhz
Graphics Card(s)
EVGA GeForce GTX 750 Superclocked 1GB 128-Bit GDDR5
Monitor(s) Displays
LG 32MA68HY 32" IPS
Screen Resolution
1920 x 1080
Hard Drives
Samsung 840 Evo 120GB, SEAGATE 500GB Barracuda® 7200.12, SATA 3 Gb/s, 7200 RPM, 16MB cache
PSU
ANTEC TruePower New TP-550, 80 PLUS, 550W
Case
ANTEC Three Hundred Illusion
Cooling
COOLER MASTER Hyper 212 Plus, 4 x 120mm 1 x 140mm Noctua's
Internet Speed
85 + Mbps
Antivirus
Avast
Browser
Vivaldi
Guy, I tried your suggestion just to see if the directory focus could be changed to My Documents, but I get the same error mentioned originally. Starting at C:> I can get to C:\Users\Owner> But the CD command cannot find the specified path when I try C:\Users\Owner>cd My\ Documents. Thank you for your suggestion, it was certainly worth a try. Freedom of wind in the face and ears a-flapping - Great sig.
 

My Computer My Computer

At a glance

Windows 7 Pro x64Intel Core i7M620 2.67 GHz4 GB
Computer type
Laptop
Computer Manufacturer/Model Number
MSI MS-1733
OS
Windows 7 Pro x64
CPU
Intel Core i7M620 2.67 GHz
Motherboard
MSI MS-1733 Ver.001
Memory
4 GB
Hard Drives
2 x 320GB
Antivirus
ESET NOD32
Browser
IE 8
Try this command:
DIR C:\Users\Owner\Documents /o:n /s > DirTreeList.txt
 

My Computer My Computer

At a glance

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x6...AMD Athlon II x4 6206GB GSkill DDR2 800AMD 4670 GPU + AMD 4200 IGP
Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
AMD 4670 GPU + AMD 4200 IGP
Sound Card
on board Realtek ALC889A
Monitor(s) Displays
RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor
Screen Resolution
1680 x 1050
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.

Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.

Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner.
Thank you David, that WORKED! I successfully got the directory list I was after. I will document this solution so I never lose it. Thanks again to you both. I have marked the problem as solved.
 

My Computer My Computer

At a glance

Windows 7 Pro x64Intel Core i7M620 2.67 GHz4 GB
Computer type
Laptop
Computer Manufacturer/Model Number
MSI MS-1733
OS
Windows 7 Pro x64
CPU
Intel Core i7M620 2.67 GHz
Motherboard
MSI MS-1733 Ver.001
Memory
4 GB
Hard Drives
2 x 320GB
Antivirus
ESET NOD32
Browser
IE 8
You're welcome!
Glad you got it solved.
:)
 

My Computer My Computer

At a glance

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x6...AMD Athlon II x4 6206GB GSkill DDR2 800AMD 4670 GPU + AMD 4200 IGP
Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
AMD 4670 GPU + AMD 4200 IGP
Sound Card
on board Realtek ALC889A
Monitor(s) Displays
RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor
Screen Resolution
1680 x 1050
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.

Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.

Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner.
Good one David. I considered that, but the whole library thing confuses me ;) Glad you got it sorted utnatw7f387. A Guy
 

My Computer My Computer

At a glance

Windows 10 Home x64INTEL Core i5-750 Quad-Core 3.37GHzHyperX Fury Black Series 8GB (2 x 4GB) 1866MhzEVGA GeForce GTX 750 Superclocked 1GB 128-Bit...
Computer type
PC/Desktop
OS
Windows 10 Home x64
CPU
INTEL Core i5-750 Quad-Core 3.37GHz
Motherboard
ASUS P7P55D
Memory
HyperX Fury Black Series 8GB (2 x 4GB) 1866Mhz
Graphics Card(s)
EVGA GeForce GTX 750 Superclocked 1GB 128-Bit GDDR5
Monitor(s) Displays
LG 32MA68HY 32" IPS
Screen Resolution
1920 x 1080
Hard Drives
Samsung 840 Evo 120GB, SEAGATE 500GB Barracuda® 7200.12, SATA 3 Gb/s, 7200 RPM, 16MB cache
PSU
ANTEC TruePower New TP-550, 80 PLUS, 550W
Case
ANTEC Three Hundred Illusion
Cooling
COOLER MASTER Hyper 212 Plus, 4 x 120mm 1 x 140mm Noctua's
Internet Speed
85 + Mbps
Antivirus
Avast
Browser
Vivaldi
I checked and found this solution works for all User directories beginning with My. I also checked to see if it worked for User directory names like Saved Games, Start Menu, & Virtual Machines. In those cases, the full name with the space is accepted by the CD command. There is nothing quite as nice as consistency and adequate documentation of odd features, is there? I don't have a need for directory lists for system directories not related to a user, but it would be nice to know if this solution will work in those cases, too. Thanks again to both of you, you saved my day. Any further thoughts guys?
 

My Computer My Computer

At a glance

Windows 7 Pro x64Intel Core i7M620 2.67 GHz4 GB
Computer type
Laptop
Computer Manufacturer/Model Number
MSI MS-1733
OS
Windows 7 Pro x64
CPU
Intel Core i7M620 2.67 GHz
Motherboard
MSI MS-1733 Ver.001
Memory
4 GB
Hard Drives
2 x 320GB
Antivirus
ESET NOD32
Browser
IE 8
The problem is with Win 7 "My Documents" is a Junction Point, and the directory (folder) name is Documents.
Yup, it makes it confusing because you see "My Documents" in Windows Explorer.
But, if you do a DIR command in a CMD window you will see "Documents" as the folder name in your User directory.
:confused:
 

My Computer My Computer

At a glance

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x6...AMD Athlon II x4 6206GB GSkill DDR2 800AMD 4670 GPU + AMD 4200 IGP
Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
AMD 4670 GPU + AMD 4200 IGP
Sound Card
on board Realtek ALC889A
Monitor(s) Displays
RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor
Screen Resolution
1680 x 1050
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.

Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.

Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner.
Thanks Dave, I think that clears this up quite a bit. In the meantime I checked some other directory names with spaces and the CD command accepts them all. I hate to keep asking questions, but are there other Junction Point situations other than those we see as My ...?
BTW are you aware of this odd but useful undocumented feature?
The "Include subfolders in search results..." switch in WE Tools > Folder Options > Search > How to search behaves differently for the two My Documents access points. Searches under Desktop > Libraries > Documents > My Documents always searches all sub-folders independent of this switch. That's probably a good idea for users who have no idea where their lost files might be. But, searches in C:\Users\Owner\Documents respond to the switch setting. That's kind of handy if you have a better idea of where your lost files might be located. Accident or deliberate, it's kind of a neat feature to know about.
 

My Computer My Computer

At a glance

Windows 7 Pro x64Intel Core i7M620 2.67 GHz4 GB
Computer type
Laptop
Computer Manufacturer/Model Number
MSI MS-1733
OS
Windows 7 Pro x64
CPU
Intel Core i7M620 2.67 GHz
Motherboard
MSI MS-1733 Ver.001
Memory
4 GB
Hard Drives
2 x 320GB
Antivirus
ESET NOD32
Browser
IE 8
I'm not sure what other Junction Points there are that you might run into :(
Maybe one of the experts here will see this and have an answer...

I mainly use File Locator Lite for file searches, as it's easier for me and has always worked very well...
I do like the Start Search box for programs, and often use that.
 

My Computer My Computer

At a glance

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x6...AMD Athlon II x4 6206GB GSkill DDR2 800AMD 4670 GPU + AMD 4200 IGP
Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
AMD 4670 GPU + AMD 4200 IGP
Sound Card
on board Realtek ALC889A
Monitor(s) Displays
RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor
Screen Resolution
1680 x 1050
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.

Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.

Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner.
Back
Top