2013/12/17更新:使用了一段時間,開機時有時會出現一些錯誤,不過不影響正常使用,不能忍的是會常常更新,因此暫時不推薦使用。html
爲了方便地重裝系統,同時保留用戶數據,想到了分離windows系統文件和用戶數據。通過各方搜索,終於成功,現總結以下。linux
主要把Users和ProgramData移出系統盤(Program Files和Program Files (x86)可根據我的須要選擇是否移動),這裏以從C:\Users和C:\ProgramData移動到D:\Users和D:\ProgramData,win8系統爲例。windows
主要有兩種途徑,一是在安裝系統將要建立用戶的時候按Shift+F10進入命令提示符,二是在安裝系統後進入修復模式,核心思想都是將Users和ProgramData移動到目標文件夾,在系統盤創建硬鏈接。安全
方法1、安裝系統時移動this
一、將要建立用戶的時候按Shift+F10進入命令提示符;spa
二、複製Users、ProgramData 文件夾到你想使用的分區上code
robocopy "C:\Users" "D:\Users" /E /COPYALL /XJ
robocopy "C:\ProgramData" "D:\ProgramData" /E /COPYALL /XJ
請保證 0 Failed,若是不行,能夠多試幾回,仍是不行,請自行想辦法,異曲同工(好比能夠在在linux下移動)。htm
參數解釋:blog
/E :: 複製子目錄,包括空的子目錄。ci
/COPY:複製標記:: 要複製的文件內容(默認爲 /COPY:DAT)。
(複製標記: D=數據,A=屬性,T=時間戳)。
(S=安全=NTFS ACL,O=全部者信息,U=審覈信息) 。
/COPYALL :: 複製全部文件信息(等同於 /COPY:DATSOU)。
/XJ :: 排除接合點(默認狀況下一般包括)。
也有這種用法:
robocopy /copyall /mir /xj C:\Users D:\Users
robocopy /copyall /mir /xj C:\ProgramData D:\ProgramData
參數解釋:
/mir :: 鏡像目錄樹(等同於 /E 加 /PURGE)。
/PURGE :: 刪除源中再也不存在的目標文件/目錄。(加入D:\Users原來有數據,使用/PURGE會被刪除)。
說明:windows不區分大小寫,路徑中沒有空白字符則不須要轉義或加雙引號。
三、刪除系統盤原文件
這裏採用將原文件夾重命名的方式,一來達到了刪除的效果,二來備份了原文件夾,這樣萬一出現問題還可恢復,確保無誤後再刪除也不遲。
move "C:\Users" "C:\Users2"
move "C:\ProgramData" "C:\ProgramData2"
全部步驟完成以後能夠以下刪除原文件夾,但如今先跳過。
rmdir "C:\Users2" /S /Q rmdir "C:\ProgramData2" /S /Q
參數解釋:
/S: 除目錄自己外,還將刪除指定目錄下的全部子目錄和文件。用於刪除目錄樹。
/Q: 安靜模式,帶 /S 刪除目錄樹時不要求確認。
四、建立鏈接
mklink /J "C:\Users" "D:\Users"
mklink /J "C:\ProgramData" "D:\ProgramData"
參數解釋:
Use the /J switch to create a junction that's a hard symlink. (If you use the /D switch, you'll also have to edit the registry, cuz it won't be a hard link.)
五、繼續接下來的安裝便可。
方法2、安裝系統後移動(推薦)
進入修復模式,打開命令提示符,按方法一步驟2,3,4操做,重啓電腦便可。
下面談談可能會遇到的幾個問題。
一、不論用哪一種方法,都要確認驅動器盤符,按照方法一多硬盤時更是如此,方法二也會有問題,有時候驅動器盤符不必定和本身指望的一致。
二、在沒有發生故障的狀況下,win8進入修復模式有兩種方法:
In Windows 8 they dropped the use of the F8 key to access the boot menu.
Now to access such menu you can hold Shift before you press Restart (so already within Windows) and you'll be presented with it after the reboot. Another way is to press "Restart now" at the general PC settings:
Boot menu:
Troubleshoot
Advanced options
選擇命令提示符便可。
關於分離系統文件和用戶數據的弊端:
Using this setting to redirect folders to a drive other than the system volume blocks upgrades.Using ProfilesDirectory to point to a directory that is not the system volume will block SKU upgrades and upgrades to future versions of Windows. ... The servicing stack does not handle cross-volume transactions, and it blocks upgrades.
官方文檔:http://technet.microsoft.com/en-us/library/cc722177(v=WS.10).aspx
我的建議:忽略之
cite:
http://acer.it168.com/thread-1205482-1-1.html
http://lifehacker.com/5467758/move-the-users-directory-in-windows-7
http://superuser.com/questions/496493/how-do-i-access-windows-8-recovery-partition-and-how-to-recover-it-to-factory-im
http://www.zdnet.com/dont-move-your-windows-user-profiles-folder-to-another-drive-7000022142/
http://technet.microsoft.com/en-us/library/cc722177(v=WS.10).aspx