0xAA55 发表于 2016-3-7 02:26:59

教你在UEFI引导模式下强行将整个系统完整复制到另一个硬盘并设置引导并且可以正常使用!

虽然很多人问我说:“我买了新的固态硬盘!它跑分比现在的硬盘不知高到哪里去了!但我要怎样才能把我的系统‘移植’到这个固态硬盘上呢?”

我总是回答:
“重装系统。”

“……”

“装机费100元。电脑拿来。”

“好。。”

之所以回答“重装系统”是因为,UEFI模式引导的系统
但,现在我要告诉大家一个有用的答案了。你其实可以把你的系统完整复制到固态硬盘上,不需要安装固态硬盘的。但是这个过程比较折腾。希望大家做好准备。

首先你需要一个Win7的安装盘。我们需要使用的是它里面的WinRE内存盘系统。当然你要是不介意使用WinPE也是可以的。但,从系统安全的角度来看,不推荐任何WinPE,除非是自制的。

大致步骤如下:

[*]刻录一个MSDN原版Windows 7的DVD光盘(ISO镜像点此获取)
[*]将新的固态硬盘初始化为GPT分区类型,建立UEFI引导。
这个UEFI引导让我觉得十分诡异,因为我用bootrec、bcdboot、bcdedit怎么设置,它都会报0xc000000f,因此我的解决办法是:

[*]使用Win7系统盘,把一个全新的系统安装进新的固态硬盘。
[*]然后把这个固态硬盘格式化了。这样的话,我们就得到了一个可以用的UEFI引导了。
[*](再次)使用Win7系统盘进入安装系统的界面,但是并不安装系统,而是打开CMD,使用ROBOCOPY命令完成整个系统分区的文件的拷贝。
[*]修改新的系统的注册表,使其将自己所在的固态硬盘分配“C”盘符。


好。然后就是实际开动了。
首先就是刻盘。我已经刻好了。空DVD只要几块钱就能买到。直接用自己的DVD-RW将ISO刻录进去就OK。



刻录好以后,把光盘放进光驱,然后关机,插上新的固态硬盘,拔掉其它所有硬盘。再次开机,让电脑从光盘引导。然后安装一次系统。这次这样操作只是为了让操作系统安装器完成引导的安装。

先关机。


然后开机进入光盘。


点下一步。


点现在安装。





点“我接受许可条款(A)”然后点“下一步(N)”


点“自定义”


点“下一步”。分区的话,固态硬盘建议整个固态都只使用一个分区,除非你的固态足够大。


这里默默地等它装好,不要作死拔光盘。。


在它要重启的时候,关闭电脑,然后插上你的旧的系统盘。之后再开机,并重新进入光盘引导。


继续按照刚才的步骤进到设置分区的位置。
点“驱动器选项”。


这一步是为了格式化新的固态硬盘的系统分区(因为我们需要将旧的系统复制到这里,所以必须先把这里的文件删除干净)。
选择你的新的固态硬盘的系统分区,然后点“格式化”。
这里千万别选错了。请仔细区分,找到真正的你的新固态硬盘的分区。
如果无法区分,那么你只能先重启回到旧的系统,手动对新的固态硬盘进行格式化。格式化完了以后,重启从光盘引导,然后跳过这一步。


点“确定”。


格式化好了以后,按Shift+F10,呼出CMD


先确定你的原系统盘在哪个分区(盘符),然后确定你的新系统盘在哪个分区。因为这是光盘的WinRE,所以它会按照自己的方式给所有硬盘分配盘符。这个盘符和你的系统里定义的不一样。所以,不能弄错。


使用robocopy进行整个系统盘的拷贝。这个命令可以完整复制所有的文件,但是我们需要先通过robocopy /?来查看它的参数。

那么根据我的要求,我使用的命令参数是:robocopy /e /zb /efsraw /copyall /dcopy:t /xj /r:1 /w:1 /ns /nc /np /log:d:\robocopy.log c:\ d:\请大家按照自己的情况,选择性修改其中的命令参数。
其中,“/e”表示复制所有的文件夹,即使它是空的。Windows有很多空文件夹,这些文件夹都是有用的,不能随便删。
“/zb”表示如果复制失败了,使用“可重启模式”,如果“可重启模式”也不行,就使用“备份模式”
“/efsraw”保证复制加密的文件时不会失败。
“/copyall”保留所有的安全信息、所有者信息等。
“/dcopy:t”保留目录时间戳。
“/xj”防止复制junction导致死锁。
“/r:1”失败后的重试次数,为1,重试一次。
“/w:1”重试之间的等待间隔,设为1秒。
“/ns /nc /np”这是日志的记录选项,不记录文件大小、不记录文件类别、不记录拷贝百分比。
“/log:d:\robocopy.log”将Unicode编码的日志写入“d:\robocopy.log”。不使用Unicode可以保证能用type命令查看日志。
本来可以用“/tee”开关使控制台也输出日志的,但是这样会减慢速度。
“C:\ D:\”将C盘中的文件全部复制到D盘。


复制完了以后,重启进BIOS,设置启动项。一定要将第一个启动项设置为新的固态硬盘,否则你可能分不清它到底启动的是哪个系统。
设置好了以后,开机。
通常情况下大家的电脑应该能正确开机,但是也会遇到意外——新的固态硬盘如果被用户指定了盘符,那么系统会把自身所在的盘当作D盘,然后靠访问旧的C盘的文件保持运行。虽然你看不出它有什么异常,但是这样的话,就意味着它仍然依赖旧的硬盘。因此我们需要解决这个问题。
首先开机后按下Windows徽标键+R,运行注册表编辑器。


然后展开到HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices


将其中“\DosDevices\D:”和“\DosDevices\C:”的名字互换一下。(也就是将“\DosDevices\D:”的数值和“\DosDevices\C:”的数值对调一下。别搞错了。)


弄好以后,关机,然后拔掉旧硬盘。
再次开机以后,你就会发现你已经能成功进入系统了。


进来以后先别急。因为复制整个系统的过程破坏掉了你的C盘原有的各种硬链接。因此你需要修复它们。
运行以下批命令。@echo off

robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Documents and Settings" "%HOMEDRIVE%\Users"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Program Files\Windows NT\附件" "%HOMEDRIVE%\Program Files\Windows NT\Accessories"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\Application Data" "%ALLUSERSPROFILE%"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\Desktop" "%HOMEDRIVE%\Users\Public\Desktop"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\Documents" "%HOMEDRIVE%\Users\Public\Documents"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\Favorites" "%HOMEDRIVE%\Users\Public\Favorites"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\Start Menu" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\Templates" "%ALLUSERSPROFILE%\Microsoft\Windows\Templates"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\「开始」菜单" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\收藏夹" "%HOMEDRIVE%\Users\Public\Favorites"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\桌面" "%HOMEDRIVE%\Users\Public\Desktop"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\程序" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users" "%ALLUSERSPROFILE%"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default User" "%HOMEDRIVE%\Users\Default"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Application Data" "%USERPROFILE%\AppData\Roaming"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Cookies" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Local Settings" "%USERPROFILE%\AppData\Local"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\My Documents" "%USERPROFILE%\Documents"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\NetHood" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Network Shortcuts"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\PrintHood" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Printer Shortcuts"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Recent" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\SendTo" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Templates" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Templates"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\「开始」菜单" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\AppData\Local\Application Data" "%USERPROFILE%\AppData\Local"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\AppData\Local\History" "%USERPROFILE%\AppData\Local\Microsoft\Windows\History"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\AppData\Local\Temporary Internet Files" "%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\程序" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Documents\My Music" "%USERPROFILE%\Music"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Documents\My Pictures" "%USERPROFILE%\Pictures"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%USERPROFILE%\Documents\My Videos" "%USERPROFILE%\Videos"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\Application Data" "%ALLUSERSPROFILE%"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\Desktop" "%HOMEDRIVE%\Users\Public\Desktop"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\Documents" "%HOMEDRIVE%\Users\Public\Documents"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\Favorites" "%HOMEDRIVE%\Users\Public\Favorites"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\Start Menu" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\Templates" "%ALLUSERSPROFILE%\Microsoft\Windows\Templates"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\「开始」菜单" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\收藏夹" "%HOMEDRIVE%\Users\Public\Favorites"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\桌面" "%HOMEDRIVE%\Users\Public\Desktop"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\All Users\Microsoft\Windows\Start Menu\程序" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Application Data" "%HOMEDRIVE%\Users\Default\AppData\Roaming"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Cookies" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Cookies"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Local Settings" "%HOMEDRIVE%\Users\Default\AppData\Local"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\My Documents" "%HOMEDRIVE%\Users\Default\Documents"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\NetHood" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Network Shortcuts"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\PrintHood" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Printer Shortcuts"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Recent" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Recent"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\SendTo" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Start Menu" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Templates" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Templates"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\「开始」菜单" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\AppData\Local\Application Data" "%HOMEDRIVE%\Users\Default\AppData\Local"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\AppData\Local\History" "%HOMEDRIVE%\Users\Default\AppData\Local\Microsoft\Windows\History"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\AppData\Local\Temporary Internet Files" "%HOMEDRIVE%\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\程序" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Documents\My Music" "%HOMEDRIVE%\Users\Default\Music"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Documents\My Pictures" "%HOMEDRIVE%\Users\Default\Pictures"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Default\Documents\My Videos" "%HOMEDRIVE%\Users\Default\Videos"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Public\Documents\My Music" "%HOMEDRIVE%\Users\Public\Music"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Public\Documents\My Pictures" "%HOMEDRIVE%\Users\Public\Pictures"
robocopy /e /zb /efsraw /copyall /dcopy:t /move /xo /xj /r:1 /w:1 /ns /nc /nfl /ndl /np "%HOMEDRIVE%\Users\Public\Documents\My Videos" "%HOMEDRIVE%\Users\Public\Videos"

rmdir /s /q "%HOMEDRIVE%\Documents and Settings"
rmdir /s /q "%HOMEDRIVE%\Program Files\Windows NT\附件"
rmdir /s /q "%ALLUSERSPROFILE%\Application Data"
rmdir /s /q "%ALLUSERSPROFILE%\Desktop"
rmdir /s /q "%ALLUSERSPROFILE%\Documents"
rmdir /s /q "%ALLUSERSPROFILE%\Favorites"
rmdir /s /q "%ALLUSERSPROFILE%\Start Menu"
rmdir /s /q "%ALLUSERSPROFILE%\Templates"
rmdir /s /q "%ALLUSERSPROFILE%\「开始」菜单"
rmdir /s /q "%ALLUSERSPROFILE%\收藏夹"
rmdir /s /q "%ALLUSERSPROFILE%\桌面"
rmdir /s /q "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\程序"
rmdir /s /q "%HOMEDRIVE%\Users\All Users"
rmdir /s /q "%HOMEDRIVE%\Users\Default User"
rmdir /s /q "%USERPROFILE%\Application Data"
rmdir /s /q "%USERPROFILE%\Cookies"
rmdir /s /q "%USERPROFILE%\Local Settings"
rmdir /s /q "%USERPROFILE%\My Documents"
rmdir /s /q "%USERPROFILE%\NetHood"
rmdir /s /q "%USERPROFILE%\PrintHood"
rmdir /s /q "%USERPROFILE%\Recent"
rmdir /s /q "%USERPROFILE%\SendTo"
rmdir /s /q "%USERPROFILE%\Templates"
rmdir /s /q "%USERPROFILE%\「开始」菜单"
rmdir /s /q "%USERPROFILE%\AppData\Local\Application Data"
rmdir /s /q "%USERPROFILE%\AppData\Local\History"
rmdir /s /q "%USERPROFILE%\AppData\Local\Temporary Internet Files"
rmdir /s /q "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\程序"
rmdir /s /q "%USERPROFILE%\Documents\My Music"
rmdir /s /q "%USERPROFILE%\Documents\My Pictures"
rmdir /s /q "%USERPROFILE%\Documents\My Videos"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\Application Data"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\Desktop"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\Documents"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\Favorites"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\Start Menu"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\Templates"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\「开始」菜单"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\收藏夹"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\桌面"
rmdir /s /q "%HOMEDRIVE%\Users\All Users\Microsoft\Windows\Start Menu\程序"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Application Data"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Cookies"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Local Settings"
rmdir /s /q "%HOMEDRIVE%\Users\Default\My Documents"
rmdir /s /q "%HOMEDRIVE%\Users\Default\NetHood"
rmdir /s /q "%HOMEDRIVE%\Users\Default\PrintHood"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Recent"
rmdir /s /q "%HOMEDRIVE%\Users\Default\SendTo"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Start Menu"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Templates"
rmdir /s /q "%HOMEDRIVE%\Users\Default\「开始」菜单"
rmdir /s /q "%HOMEDRIVE%\Users\Default\AppData\Local\Application Data"
rmdir /s /q "%HOMEDRIVE%\Users\Default\AppData\Local\History"
rmdir /s /q "%HOMEDRIVE%\Users\Default\AppData\Local\Temporary Internet Files"
rmdir /s /q "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\程序"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Documents\My Music"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Documents\My Pictures"
rmdir /s /q "%HOMEDRIVE%\Users\Default\Documents\My Videos"
rmdir /s /q "%HOMEDRIVE%\Users\Public\Documents\My Music"
rmdir /s /q "%HOMEDRIVE%\Users\Public\Documents\My Pictures"
rmdir /s /q "%HOMEDRIVE%\Users\Public\Documents\My Videos"

mklink /j "%HOMEDRIVE%\Documents and Settings" "%HOMEDRIVE%\Users"
mklink /j "%HOMEDRIVE%\Program Files\Windows NT\附件" "%HOMEDRIVE%\Program Files\Windows NT\Accessories"
mklink /j "%ALLUSERSPROFILE%\Application Data" "%ALLUSERSPROFILE%"
mklink /j "%ALLUSERSPROFILE%\Desktop" "%HOMEDRIVE%\Users\Public\Desktop"
mklink /j "%ALLUSERSPROFILE%\Documents" "%HOMEDRIVE%\Users\Public\Documents"
mklink /j "%ALLUSERSPROFILE%\Favorites" "%HOMEDRIVE%\Users\Public\Favorites"
mklink /j "%ALLUSERSPROFILE%\Start Menu" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
mklink /j "%ALLUSERSPROFILE%\Templates" "%ALLUSERSPROFILE%\Microsoft\Windows\Templates"
mklink /j "%ALLUSERSPROFILE%\「开始」菜单" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
mklink /j "%ALLUSERSPROFILE%\收藏夹" "%HOMEDRIVE%\Users\Public\Favorites"
mklink /j "%ALLUSERSPROFILE%\桌面" "%HOMEDRIVE%\Users\Public\Desktop"
mklink /j "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\程序" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs"
mklink /d "%HOMEDRIVE%\Users\All Users" "%ALLUSERSPROFILE%"
mklink /j "%HOMEDRIVE%\Users\Default User" "%HOMEDRIVE%\Users\Default"
mklink /j "%USERPROFILE%\Application Data" "%USERPROFILE%\AppData\Roaming"
mklink /j "%USERPROFILE%\Cookies" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies"
mklink /j "%USERPROFILE%\Local Settings" "%USERPROFILE%\AppData\Local"
mklink /j "%USERPROFILE%\My Documents" "%USERPROFILE%\Documents"
mklink /j "%USERPROFILE%\NetHood" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Network Shortcuts"
mklink /j "%USERPROFILE%\PrintHood" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Printer Shortcuts"
mklink /j "%USERPROFILE%\Recent" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent"
mklink /j "%USERPROFILE%\SendTo" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo"
mklink /j "%USERPROFILE%\Templates" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Templates"
mklink /j "%USERPROFILE%\「开始」菜单" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu"
mklink /j "%USERPROFILE%\AppData\Local\Application Data" "%USERPROFILE%\AppData\Local"
mklink /j "%USERPROFILE%\AppData\Local\History" "%USERPROFILE%\AppData\Local\Microsoft\Windows\History"
mklink /j "%USERPROFILE%\AppData\Local\Temporary Internet Files" "%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files"
mklink /j "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\程序" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
mklink /j "%USERPROFILE%\Documents\My Music" "%USERPROFILE%\Music"
mklink /j "%USERPROFILE%\Documents\My Pictures" "%USERPROFILE%\Pictures"
mklink /j "%USERPROFILE%\Documents\My Videos" "%USERPROFILE%\Videos"
mklink /j "%HOMEDRIVE%\Users\All Users\Application Data" "%ALLUSERSPROFILE%"
mklink /j "%HOMEDRIVE%\Users\All Users\Desktop" "%HOMEDRIVE%\Users\Public\Desktop"
mklink /j "%HOMEDRIVE%\Users\All Users\Documents" "%HOMEDRIVE%\Users\Public\Documents"
mklink /j "%HOMEDRIVE%\Users\All Users\Favorites" "%HOMEDRIVE%\Users\Public\Favorites"
mklink /j "%HOMEDRIVE%\Users\All Users\Start Menu" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
mklink /j "%HOMEDRIVE%\Users\All Users\Templates" "%ALLUSERSPROFILE%\Microsoft\Windows\Templates"
mklink /j "%HOMEDRIVE%\Users\All Users\「开始」菜单" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu"
mklink /j "%HOMEDRIVE%\Users\All Users\收藏夹" "%HOMEDRIVE%\Users\Public\Favorites"
mklink /j "%HOMEDRIVE%\Users\All Users\桌面" "%HOMEDRIVE%\Users\Public\Desktop"
mklink /j "%HOMEDRIVE%\Users\All Users\Microsoft\Windows\Start Menu\程序" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs"
mklink /j "%HOMEDRIVE%\Users\Default\Application Data" "%HOMEDRIVE%\Users\Default\AppData\Roaming"
mklink /j "%HOMEDRIVE%\Users\Default\Cookies" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Cookies"
mklink /j "%HOMEDRIVE%\Users\Default\Local Settings" "%HOMEDRIVE%\Users\Default\AppData\Local"
mklink /j "%HOMEDRIVE%\Users\Default\My Documents" "%HOMEDRIVE%\Users\Default\Documents"
mklink /j "%HOMEDRIVE%\Users\Default\NetHood" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Network Shortcuts"
mklink /j "%HOMEDRIVE%\Users\Default\PrintHood" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Printer Shortcuts"
mklink /j "%HOMEDRIVE%\Users\Default\Recent" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Recent"
mklink /j "%HOMEDRIVE%\Users\Default\SendTo" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo"
mklink /j "%HOMEDRIVE%\Users\Default\Start Menu" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu"
mklink /j "%HOMEDRIVE%\Users\Default\Templates" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Templates"
mklink /j "%HOMEDRIVE%\Users\Default\「开始」菜单" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu"
mklink /j "%HOMEDRIVE%\Users\Default\AppData\Local\Application Data" "%HOMEDRIVE%\Users\Default\AppData\Local"
mklink /j "%HOMEDRIVE%\Users\Default\AppData\Local\History" "%HOMEDRIVE%\Users\Default\AppData\Local\Microsoft\Windows\History"
mklink /j "%HOMEDRIVE%\Users\Default\AppData\Local\Temporary Internet Files" "%HOMEDRIVE%\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files"
mklink /j "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\程序" "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
mklink /j "%HOMEDRIVE%\Users\Default\Documents\My Music" "%HOMEDRIVE%\Users\Default\Music"
mklink /j "%HOMEDRIVE%\Users\Default\Documents\My Pictures" "%HOMEDRIVE%\Users\Default\Pictures"
mklink /j "%HOMEDRIVE%\Users\Default\Documents\My Videos" "%HOMEDRIVE%\Users\Default\Videos"
mklink /j "%HOMEDRIVE%\Users\Public\Documents\My Music" "%HOMEDRIVE%\Users\Public\Music"
mklink /j "%HOMEDRIVE%\Users\Public\Documents\My Pictures" "%HOMEDRIVE%\Users\Public\Pictures"
mklink /j "%HOMEDRIVE%\Users\Public\Documents\My Videos" "%HOMEDRIVE%\Users\Public\Videos"

attrib +s +h /l "%HOMEDRIVE%\Documents and Settings"
attrib +s +h /l "%HOMEDRIVE%\Program Files\Windows NT\附件"
attrib +s +h /l "%ALLUSERSPROFILE%\Application Data"
attrib +s +h /l "%ALLUSERSPROFILE%\Desktop"
attrib +s +h /l "%ALLUSERSPROFILE%\Documents"
attrib +s +h /l "%ALLUSERSPROFILE%\Favorites"
attrib +s +h /l "%ALLUSERSPROFILE%\Start Menu"
attrib +s +h /l "%ALLUSERSPROFILE%\Templates"
attrib +s +h /l "%ALLUSERSPROFILE%\「开始」菜单"
attrib +s +h /l "%ALLUSERSPROFILE%\收藏夹"
attrib +s +h /l "%ALLUSERSPROFILE%\桌面"
attrib +s +h /l "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\程序"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users"
attrib +s +h /l "%HOMEDRIVE%\Users\Default User"
attrib +s +h /l "%USERPROFILE%\Application Data"
attrib +s +h /l "%USERPROFILE%\Cookies"
attrib +s +h /l "%USERPROFILE%\Local Settings"
attrib +s +h /l "%USERPROFILE%\My Documents"
attrib +s +h /l "%USERPROFILE%\NetHood"
attrib +s +h /l "%USERPROFILE%\PrintHood"
attrib +s +h /l "%USERPROFILE%\Recent"
attrib +s +h /l "%USERPROFILE%\SendTo"
attrib +s +h /l "%USERPROFILE%\Templates"
attrib +s +h /l "%USERPROFILE%\「开始」菜单"
attrib +s +h /l "%USERPROFILE%\AppData\Local\Application Data"
attrib +s +h /l "%USERPROFILE%\AppData\Local\History"
attrib +s +h /l "%USERPROFILE%\AppData\Local\Temporary Internet Files"
attrib +s +h /l "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\程序"
attrib +s +h /l "%USERPROFILE%\Documents\My Music"
attrib +s +h /l "%USERPROFILE%\Documents\My Pictures"
attrib +s +h /l "%USERPROFILE%\Documents\My Videos"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\Application Data"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\Desktop"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\Documents"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\Favorites"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\Start Menu"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\Templates"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\「开始」菜单"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\收藏夹"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\桌面"
attrib +s +h /l "%HOMEDRIVE%\Users\All Users\Microsoft\Windows\Start Menu\程序"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Application Data"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Cookies"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Local Settings"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\My Documents"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\NetHood"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\PrintHood"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Recent"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\SendTo"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Start Menu"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Templates"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\「开始」菜单"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\AppData\Local\Application Data"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\AppData\Local\History"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\AppData\Local\Temporary Internet Files"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\程序"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Documents\My Music"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Documents\My Pictures"
attrib +s +h /l "%HOMEDRIVE%\Users\Default\Documents\My Videos"
attrib +s +h /l "%HOMEDRIVE%\Users\Public\Documents\My Music"
attrib +s +h /l "%HOMEDRIVE%\Users\Public\Documents\My Pictures"
attrib +s +h /l "%HOMEDRIVE%\Users\Public\Documents\My Videos"

pause目前为止,整个系统的复制过程就完成了。旧的硬盘也可以格了。但抽空也先看一下robocopy.log里面有没有记录复制失败的文件。有的话,自己处理一下。

0x01810 发表于 2016-5-9 11:56:00

修复硬链接真是够烦的
页: [1]
查看完整版本: 教你在UEFI引导模式下强行将整个系统完整复制到另一个硬盘并设置引导并且可以正常使用!