China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 10:19
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to create a folder with spaces under DOS? View 1,952 Replies 6
Original Poster Posted 2006-11-09 00:17 ·  中国 广东 深圳 南山区 电信
新手上路
Credits 12
Posts 9
Joined 2006-03-17 17:55
20-year member
UID 52277
Status Offline
I saw online that someone made a C drive data transfer tool. The realization principle is like this:
There are five folders in the compressed file: temp, oe, my documents, favorites, desktop. When self-extracting, these five folders are extracted to d:\personal. Then a bat file is used to call the xcopy command to copy all the contents of the corresponding folders on the C drive over. Finally, a reg file is used to change the corresponding file paths in the registry to the folders under d:\personal.

REGEDIT4


"Cache"="D:\\Personal\\Temporary Internet Files"
"Desktop"="D:\\Personal\\Desktop"
"Favorites"="D:\\Personal\\Favorites"
"Personal"="D:\\Personal\\My Documents"
"My Music"="D:\\Personal\\My Documents\\My Pictures"
"My Pictures"="D:\\Personal\\My Documents\\My Pictures"
"Recent"="D:\\Personal\\Recent"


"Cache"="D:\\Personal\\Temporary Internet Files"
"Desktop"="D:\\Personal\\Desktop"
"My Music"="D:\\Personal\\My Documents\\My Pictures"
"My Pictures"="D:\\Personal\\My Documents\\My Pictures"
"Favorites"="D:\\Personal\\Favorites"
"Personal"="D:\\Personal\\My Documents"
"Recent"="D:\\Personal\\Recent"


"Store Root"="D:\\Personal\\Outlook Express"


"Desktop"="D:\\Personal\\Desktop"
"Cache"="D:\\Personal\\My Documents"
"Download Directory"="D:\\Personal\\My Documents"


"TEMP"="D:\\Personal\\Temp"
"TMP"="D:\\Personal\\Temp"

bat:
@echo off
rem The following command has the /s parameter added, so there is no need to confirm when importing the registry.
echo Installing...
regedit.exe /s shell.reg
if exist c:\windows\system\Dxdiag.exe goto 98
xcopy C:\Docume~1\%USERNAME%\Mydocu~1\*.* D:\Personal\Mydocu~1\ /e /y
xcopy C:\Docume~1\%USERNAME%\Desktop\*.* D:\Personal\Desktop\ /e /y
xcopy C:\Docume~1\%USERNAME%\桌面\*.* D:\Personal\Desktop\ /e /y
xcopy C:\Docume~1\%USERNAME%\Favori~1\*.* D:\Personal\Favori~1\ /e /y
goto end

:98
xcopy C:\Mydocu~1\*.* D:\Personal\Mydocu~1\ /e /y
xcopy C:\WINDOWS\Desktop\*.* D:\Personal\Desktop\ /e /y
xcopy C:\WINDOWS\Favori~1\*.* D:\Personal\Favori~1\ /e /y

:end
del D:\Personal\Shell.reg >nul
del %0
echo Installation completed!

I once tried to use the md command to create the above files, but found that I couldn't create folders with spaces in the middle like "MY documents", "My pictures", "My Music". I also encountered such problems before, for example, when I used batch processing to delete files, if the file name contained spaces, it couldn't be deleted correctly. How should this problem be dealt with?

--------------------------------------------------------------------------------------------------------
The author also has such a passage in the compressed file annotation: Open OE, find Tools - Options - Maintenance - Storage Folder, click "Change", and change the path of the storage location to D:\Personal\OE. In this way, when using OneKey Ghost to restore the system later, there is no need to back up the files in these folders.

Is there a way to realize this operation through the registry or batch processing?
----------------------------------------------------------------------------------------------------------

[ Last edited by zorsite on 2006-11-9 at 12:27 AM ]
Floor 2 Posted 2006-11-09 00:53 ·  中国 北京 海淀区 联通
初级用户
★★
Credits 122
Posts 54
Joined 2006-11-03 04:24
19-year member
UID 69380
Gender Male
Status Offline
MD "JASON WANG" 注意引号
Floor 3 Posted 2006-11-09 01:41 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
md "MY documents" "My pictures" "My Music"
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-11-09 02:15
Floor 4 Posted 2006-11-09 04:07 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Moderators, take action. Such questions have been asked countless times. Why not make a FAQ?

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 5 Posted 2006-11-09 11:41 ·  中国 广东 佛山 广东睿江科技有限公司
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
Agree with what brother electronixtar said. The forum should preferably have someone in charge of compiling a FAQ every once in a while.
Floor 6 Posted 2006-11-12 04:56 ·  中国 河北 石家庄 联通
初级用户
Credits 32
Posts 13
Joined 2006-10-30 01:21
19-year member
UID 68815
Gender Male
Status Offline
Floor 7 Posted 2006-11-12 20:11 ·  中国 黑龙江 哈尔滨 联通
新手上路
Credits 2
Posts 1
Joined 2006-10-09 21:16
19-year member
UID 65081
Status Offline
I'm a newbie, don't know your intention, but this can create a directory with spaces. For example: md aaa hold down alt, then press the numeric keypad 255, release the hand, then press enter to confirm. Then a directory "aaa " is created. Remember this method was used for simple encryption in the DOS era. Two seemingly identical directories can be created under the same path. But it doesn't work well in the graphical interface.
Forum Jump: