中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-02 11:38
48,038 topics / 350,123 posts / today 1 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to create a folder with spaces under DOS?
Printable Version  1,954 / 6
Floor1 zorsite Posted 2006-11-09 00:17
新手上路 Posts 9 Credits 12
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 ]
Floor2 jasonwang Posted 2006-11-09 00:53
初级用户 Posts 54 Credits 122
MD "JASON WANG" 注意引号
Floor3 不得不爱 Posted 2006-11-09 01:41
超级版主 Posts 2,044 Credits 5,310 From 四川南充
md "MY documents" "My pictures" "My Music"
Floor4 electronixtar Posted 2006-11-09 04:07
铂金会员 Posts 2,672 Credits 7,493
Moderators, take action. Such questions have been asked countless times. Why not make a FAQ?
Floor5 voiL Posted 2006-11-09 11:41
中级用户 Posts 189 Credits 384
Agree with what brother electronixtar said. The forum should preferably have someone in charge of compiling a FAQ every once in a while.
Floor6 llgg001 Posted 2006-11-12 04:56
初级用户 Posts 13 Credits 32
Floor7 zhangxl0451 Posted 2006-11-12 20:11
新手上路 Posts 1 Credits 2
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.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023