查看單個文章
舊 2004-05-26, 12:25 AM   #1
psac
榮譽會員
 
psac 的頭像
榮譽勳章
UID - 3662
在線等級: 級別:30 | 在線時長:1048小時 | 升級還需:37小時級別:30 | 在線時長:1048小時 | 升級還需:37小時級別:30 | 在線時長:1048小時 | 升級還需:37小時級別:30 | 在線時長:1048小時 | 升級還需:37小時級別:30 | 在線時長:1048小時 | 升級還需:37小時
註冊日期: 2002-12-07
住址: 木柵市立動物園
文章: 17381
現金: 5253 金幣
資產: 33853 金幣
預設 如何更改XP「使用者設定檔」的路徑

這個方法我是從那裡改來的。http://www.slime2.com.tw/forums/showthread.php?s=&threadid=110570
試了一下,果然可以,所以就寫了這篇簡單的介紹。

說明的原文如下:

引用:
Q:
WinXP預設把用戶的我的文件、收藏夾什麼的都放到C:\Documents and Settings的相應目錄中。為了資料的安全,我想把這些內容都存到另一個分區上,比如說D:\Documents and Settings,這樣C碟有問題時,個人資料可以方便地恢復。
請問,哪位知道如何修改WinXP的預設設定,實現我的要求呢?

A.:
系統裝好也可以改,就是上一級註冊表的 ProfilesDirectory改掉,再改下面每個用戶配置。搬動用戶目錄稍微麻煩點,可以新增一個新管理員來搬,搬完刪掉。

註冊表裡可能還有一些對All Users和Administrator的目錄引用,要逐個改。
如果只是搬動單個用戶,就沒這麼麻煩,照上面說的就行了
我的正文開始:

所謂「使用者設定檔」就是儲存桌面設定和其他與用戶帳戶有關的資訊。

所有用戶的配置文件通常在C:\Documents and Settings中。下面我們就來讓它換換位置。

先來介紹一下移動單個用戶(比如SleepBoy入用戶名來講)的方法。

總共只有2步,而且做起來也很簡單。

1. 開啟註冊表編輯器,來到
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
在它下面有幾個子鍵,找到屬於被修改用戶的那個(關鍵就是看ProfileImagePath),然後把ProfileImagePath改成另外的路徑。

2. 建立D:\Documents and Settings目錄,然後把C:\Documents and Settings目錄中的SleepBoy資料夾拷到D:\Documents and Settings中就行了。如果這時正好是用SleepBoy登入的,那麼就要先登出,然後換另一個具有管理員權限的用戶登入,比如Administrator,接著就和前面一樣了。


重新用SleepBoy登入後,在桌面新增一個資料夾,然後雙按開啟,看看位址欄是不是寫著 D:\Documents and Settings\SleepBoy\桌面\新增資料夾,如果是,就說明修改成功了。


此時,SleepBoy的「收藏夾」、「IE臨時目錄」、「開始選單」、「其他軟體的配置文件」等,都自動換到D碟了。


以後C碟中的這個SleepBoy資料夾就可以完全 刪除了。

最後再來說一下把整個C:\Documents and Settings搬家的方法。第一步當然也是修改註冊表,只不過這次要把所有子鍵的ProfileImagePath鍵值都改一遍。
第二步,移動目錄前要先建一個管理員帳戶,然後用這個臨時的管理員帳戶登入,這樣才能把其他的用戶帳戶轉移出來。

另一辦法是在安裝時用自訂指令碼文件來定義MyDocumnet and Setting的磁碟代號、路徑。

環境是Win2k/98

具體步驟如下:

1.分區,一個Fat32分區,另外一個隨便什麼格式

2.準備一張Win98/Me啟動碟,修改Config.sys Autoexec.bat。文件如下:

Autoexec.bat

@ECHO OFF
set EXPAND=YES
SET DIRCMD=/O:N
set LglDrv=27 * 26 Z 25 Y 24 X 23 W 22 V 21 U 20 T 19 S 18 R 17 Q 16 P 15
set LglDrv=%LglDrv% O 14 N 13 M 12 L 11 K 10 J 9 I 8 H 7 G 6 F 5 E 4 D 3 C
cls
call setramd.bat %LglDrv%
set temp=c:\
set tmp=c:\
path=%RAMD%:\;a:\;%CDROM%:\
copy command.com %RAMD%:\ > NUL
set comspec=%RAMD%:\command.com
copy extract.exe %RAMD%:\ > NUL

:ERROR
IF EXIST ebd.cab GOTO EXT
echo Please insert Disk which has EBD.CAB
echo.
pause
GOTO ERROR

:EXT
%RAMD%:\extract /y /e /l %RAMD%: ebd.cab > NUL
echo The diagnostic tools were successfully loaded to drive %RAMD%.
echo.

IF "%config%"=="NOCD" GOTO QUIT
LH %ramd%:\MSCDEX.EXE /D:mscd001 /L:%CDROM%
IF "%config%"=="Win2k" GOTO Win2k
IF "%config%"=="Win98" GOTO Win98
echo.
GOTO QUIT

:Win2k
A:\smartdrv.exe 4096 4096
%CDROM%:\ENGLISH\WIN2000\PRO\i386\winnt.exe /u:A:\unattend.txt /t:C /s:%CDROM%:\ENGLISH\WIN2000\PRO\i386
GOTO QUIT

:Win98
A:\smartdrv.exe 4096 4096
%CDROM%:\win98\setup.exe a:\msbatch.inf /is


:QUIT
echo.
echo clean up environment variables
set CDROM=
set LglDrv=



Config.sys

[menu]
menuitem=CD, Start computer with CD-ROM support.
menuitem=NOCD, Start computer without CD-ROM support.
menuitem=Win2k,Use My ENV setup Windows2000
menuitem=Win98,Use My ENV setup windows98
menudefault=CD,30
menucolor=7,0

[CD]
files=10
buffers=10
dos=high,umb
stacks=9,256
device=himem.sys /testmemff
devicehigh=ramdrive.sys /E 2048
lastdrive=z
device=oakcdrom.sys /D:mscd001

[NOCD]
files=10
buffers=10
dos=high,umb
stacks=9,256
device=himem.sys /testmemff
devicehigh=ramdrive.sys /E 2048
lastdrive=z

[COMMON]

[Win2k]
dos=high,umb
device=himem.sys /testmemff
devicehigh=ramdrive.sys /E 2048
device=oakcdrom.sys /D:mscd001

[Win98]
dos=high,umb
device=himem.sys /testmemff
devicehigh=ramdrive.sys /E 2048
device=oakcdrom.sys /D:mscd001

註文:
win98 大同小異!批次檔也可以,msbatch.inf自動執行檔

這樣做的好處極多,容易備份,分離的..C全部只放系統......,而資料Outlook的郵件全在D碟......




參考文....原文出處 Cannot Move or Rename the Documents and Settings Folder

如果是新系統安裝時,可以指定用戶資料夾的位置的....

Cannot Move or Rename the Documents and Settings Folder
適用於
This article was previously published under Q236621
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 Description of the Microsoft Windows Registry

SYMPTOMS
If you try to move or rename the "Documents and Settings" folder in Windows, you receive the following error message:

"Documents and Settings is a Windows system folder and is required for Windows to run properly. It cannot be moved or renamed."
CAUSE
This behavior is by design.
RESOLUTION
To specify a different folder for the "Documents and Settings" folder during installation, follow these steps:
Use the /UNATTEND switch with Winnt.exe or Winnt32.exe and insert the following entry into the Unattend.txt file, where z:\foldername is the path and folder name you want:
[GuiUNattended]
ProfilesDir = z:\foldername

Install Windows. The path you included in the Unattend.txt file is used instead of the default "Documents and Settings" folder.
For additional information about unattended setup of Windows 2000, click the article number below to view the article in the Microsoft Knowledge Base:
183245 Windows 2000 Unattended Setup Parameters

MORE INFORMATION
NOTE: The following section provides information about a configuration that Microsoft does not support. We provide this information for informational purposes only; Microsoft makes no guarantee that this configuration functions properly.

WARNING: Microsoft strongly recommends against renaming any system folder. Catastrophic system failure or an unstable computer could result if you rename system folders. If implemented, a backup should be made of the system before attempting this procedure.

To rename or move the "Documents and Settings" folder, use the appropriate method.
User-specific
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

NOTE: This method does not relocate key Windows components. Use this method if you require only user-specific data to be moved.

To specify a different folder for the "Documents and Settings" folder after you install Windows for a particular user, follow these steps:
Identify the user's profile path. There are two methods to identify the profile path. Either by user path settings or user SID. The user SID method is preferred.
User SID method
Use the GETSID tool from the Windows Server Resource Kit to obtain the SID. Use syntax similar to the following example:
GETSID \\SERVER1 UserName \\SERVER1 UserName

Once you obtain the SID, use Regedit.exe or Regedt32.exe to select the user's SID under the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

User path setting
Log on to the computer as the user, and then type SET at a command prompt. Note the setting for USERPROFILE, and then close the command prompt window.
Log on as an administrator of the computer.
Use Registry Editor to add the USERPROFILE setting to the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

Click the registry key, and then click Find on the Edit menu.
In the Find box, type the value of the USERPROFILE setting, and then click Find Next.
Change the ProfileImagePath value to use the new path you want in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList registry key.
Close Registry Editor, and then log on as the user. Type SET at the command prompt to verify the path has changed.
Entire Folder
NOTE: This method relocates key Windows components. Use this method only if you require the "Documents and Settings" folder to be moved or renamed and you cannot use the Unattend.txt file to change the name during installation.

To specify a different folder for the entire "Documents and Settings" folder, including key system components, follow these steps:
Log on to the computer as an administrator.
Create a new folder.
Open the current "Documents and Settings" folder.
On the Tools menu, click Folder Options, and then click the View tab.
Under Advanced settings click Show hidden files and folders, and then click to clear the Hide file extensions for known file types and Hide protected operating system files check boxes.
Click OK.
Click and drag to copy all the folders to the new folder, except for the currently logged on users folder.
In Control Panel, double-click System, and then click the User Profiles tab.
Copy the current user's profile to the new folder.
Click OK, close Control Panel, and then log off and log on to the computer as an administrator again.
In Registry Editor, click Find on the Edit menu.
Type documents and settings, and then click Find.
Replace the value data or rename the value or registry key to the new path for each and every registry key and value that contains the original path.NOTE: You must complete this change for every instance in the registry or your computer may not start. It is imperative that you update all registry keys and values with the new path.


Restart the computer.
You can now safely remove the original "Documents and Settings" folder.

psac 目前離線  
送花文章: 3, 收花文章: 1631 篇, 收花: 3205 次