打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Win7用户文件夹转移

2010-01-22

找到三种方法:

1、mklink法:

使 用Windows XP时习惯将“我的文档”文件夹重定向到其他盘上,这样重装系统时丢失的数据少一点。在Win 7/Vista下情况有了变化,所有的用户数据都被放到了“C:\Users\用户名”这个地方,不但包括“我的文档”“我的图片”等用户自己的文件,还 包括用户的配置文件、IE的cookie、收藏夹、上网的临时文件等等。可惜的是默认情况下这个文件夹还是位于系统盘,如果能放到别的盘,那么重装系统之 后,用户所有的设置、数据将和重装前一样,那会多么方便呀。

关于Windows 7/vista下如何实现系统和用户文件分区存放,这篇文章是很好的参考,其中关键步骤引用如下:

  1. 在“计算机管理”里把Administrator用户激活,注销后用Administrator登录;
  2. 把“C:\Users\我的用户名”整个目录移到其它盘上,假设移到“D:\我的用户名”;
  3. 用mklink.exe创建目录链接:mklink.exe /D C:\Users\我的用户名 D:\我的用户名,提示会显示链接已经建立,并且会有“<==>”这样一个符号告诉你这两个目录是等同的;
  4. 重新登录你自己的账号,发现一切都没有变化,变化的只是你的文件将和系统分离,它们将更安全!
  5. 下次重装时,还用同一个用户名,先用Administrator登录后把新系统中的”C:\Users\我的用户名”删除(否则mklink.exe会报无法创建链接),再用第3步把你位于D盘上的目录重新做下链接即可

不过有些地方说得不是很清楚,我照着做时遇到了一些问题,下面是解决办法和注意事项:

一、如何启用administrator帐户

我的电脑(右键)–>管理–>本地用户和组(在左边的选项栏里)–>用户–>右边窗口找到Administrator–>右键打开Administrator属性,找到下面的帐户禁用那里,把那个禁用的勾勾去掉,点击确定。

二、无法移动“C:\Users\用户名”文件夹?

换用administrator登录之后,试图把“C:\Users\用户名”整个目录移到“D:\用户名”,却发现有些文件无法移动,无法删除。 各种办法都想尽了,UAC关了,权限全开了,甚至把这个用户账号本身删除了,但它遗留下来的User文件夹就是删不了!此时真是感觉很无力,真不知道微软 是怎么想的……还好装有双系统,切换到另一个系统下面,这个系统下面的东西还不是想怎么删就怎么删,哼,死微软~~

避免这种事情的办法呢,就是真正要用的那个用户名,最好创建之后,登录一次,什么也别做,马上换administrator。什么也别做,免得没留神哪个操作又锁定了什么文件导致无法移动;但是一定要登陆一次,让Windows初始化一些设置,否则的话,下次登陆Windows很可能自作聪明地给你建一个名为“用户名.计算机名”的文件夹,让你水中捞月一场空……

三、mklink命令的用法

Win+r,输入cmd,打开命令行界面。输入:

mklink /D C:\Users\用户名 D:\用户名

虽然按理说Windows系统是大小写不敏感的,但在我这参数/D一定要大写才能成功,也不知中了什么邪。

这样弄完之后,再换用那个用户名重新登陆——外表感觉不到有任何差别,但是内在却美了许多 :)

2、创建.bat文件:

Win7用户文件夹转移,自己用批处理写的。可以自行选择用户文件夹位置,修改了用户文件夹的 下载、游戏存档、桌面、音乐、收藏夹、图片、视频、文档、缓存及IE临时文件夹的位置,其他文件夹可以自行修改(不建议),如需修改将行首的 :: 删除即可(Shell Folders及User Shell Folders需要同时修改)。

以下是批处理内容,直接复制保存为.bat文件就能使用

@echo off
echo ============================================
echo .
echo .
echo    By Terrorist
echo .
echo .
echo ============================================
echo 将用户文件夹转移到(直接回车将转移至D:\Users\%USERNAME%\):
set /p UserFolderPath=
if not defined UserFolderPath set UserFolderPath=D:\Users\%USERNAME%\
xcopy "%USERPROFILE%" "%UserFolderPath%" /e /c /k /q /y /h

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{374DE290-123F-4565-9164-39C4925E467B}" /d "%UserFolderPath%\Downloads" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}" /d "%UserFolderPath%\Saved Games" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{56784854-C6CB-462B-8169-88E350ACB882}" /d "%UserFolderPath%\Contacts" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{7D1D3A04-DEBB-4115-95CF-2F29DA2920DA}" /d "%UserFolderPath%\Searches" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968}" /d "%UserFolderPath%\Links" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Desktop"     /d "%UserFolderPath%\Desktop" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites"     /d "%UserFolderPath%\Favorites" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music"     /d "%UserFolderPath%\Music" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures"     /d "%UserFolderPath%\Pictures" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video"     /d "%UserFolderPath%\Videos" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal"     /d "%UserFolderPath%\Documents" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{1B3EA5DC-B587-4786-B4EF-BD1DC332AEAE}"  /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Libraries" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "{A520A1A4-1780-4FF6-BD18-167343C5AF16}"  /d "%UserFolderPath%\AppData\LocalLow" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Administrative Tools"    /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Administrative Tools" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "AppData"      /d "%UserFolderPath%\AppData\Roaming" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Cache"      /d "%UserFolderPath%\AppData\Local\Microsoft\Windows\Temporary Internet Files" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "CD Burning"      /d "%UserFolderPath%\AppData\Local\Microsoft\Windows\Burn\Burn" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Cookies"     /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Cookies" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "History"      /d "%UserFolderPath%\AppData\Local\Microsoft\Windows\History" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"     /d "%UserFolderPath%\AppData\Local" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "NetHood"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Network Shortcuts" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "PrintHood"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Printer Shortcuts" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Programs"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Recent"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Recent" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "SendTo"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\SendTo" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Start Menu"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Start Menu" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Startup"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Templates"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Templates" /f

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "{374DE290-123F-4565-9164-39C4925E467B}"  /d "%UserFolderPath%\Downloads" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}"  /d "%UserFolderPath%\Saved Games" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "{56784854-C6CB-462B-8169-88E350ACB882}"  /d "%UserFolderPath%\Contacts" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "{7D1D3A04-DEBB-4115-95CF-2F29DA2920DA}"  /d "%UserFolderPath%\Searches" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "{BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968}"  /d "%UserFolderPath%\Links" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop"      /d "%UserFolderPath%\Desktop" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Favorites"     /d "%UserFolderPath%\Favorites" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Music"     /d "%UserFolderPath%\Music" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Pictures"     /d "%UserFolderPath%\Pictures" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Video"     /d "%UserFolderPath%\Videos" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal"     /d "%UserFolderPath%\Documents" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "PrintHood"     /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Printer Shortcuts" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "AppData"      /d "%UserFolderPath%\AppData\Roaming" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Cache"      /d "%UserFolderPath%\AppData\Local\Microsoft\Windows\Temporary Internet Files" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Cookies"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Cookies" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "History"      /d "%UserFolderPath%\AppData\Local\Microsoft\Windows\History" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Local AppData"      /d "%UserFolderPath%\AppData\Local" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "NetHood"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Network Shortcuts" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Programs"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Recent"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Recent" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "SendTo"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\SendTo" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Start Menu"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Start Menu" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Startup"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" /f
::reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Templates"      /d "%UserFolderPath%\AppData\Roaming\Microsoft\Windows\Templates" /f

echo 注销或重启后生效!
pause>nul

3、mklink的另一种方法

如果你用的是Windows 7操作系统,还遇到想Windows 7操作系统中把“用户文件夹”设置在非系统盘问题,没关系。本文为你详解Windows 7操作系统把“用户文件夹”设置在非系统盘。

注意:以下假设你想把用户文件夹设置在D盘,且假定D盘是NTFS分区。

一、在安装Windows 7操作系统的过程中,要求输入用户名及密码的时候,先不如输入任何信息,按“Shift+F10”呼出DOS窗口,输入以下命令:

robocopy "C:\Users" "D:\Users" /E /COPYALL /XJ
rmdir "C:\Users" /S /Q
mklink /J "C:\Users" "D:\Users"

而后关闭DOS窗口,按部就班继续安装直至完成。

如此安装的Windows 7操作系统,所有“用户特殊文件夹”(User Special Folder)的内容都已经被设置在D盘(非系统盘)上。

二、如果想要移动已安装好的Windows 7操作系统中的用户文件夹,那么就要按以下步骤操作(稍微麻烦一点,并且过程中可能会出现无法拷贝文件的情况):

0. 关闭所有应用程序;
1. 按一下“Windows”键,输入“计算机管理”之后按“Enter”,呼出“计算机管理器”;
2. 鼠标点击“Administrator”,选择属性,而后在随后的对话框中去掉“帐户已禁用”之前的勾,而后关闭“计算机管理器”;
3. 注销当前用户(注意,不是“切换用户”),而后以“Administrator”登录
4. 打开命令行窗口,输入以下命令:robocopy "C:\Users" "D:\Users" /E /COPYALL /XJ /XD "C:\Users\Administrator"
5. 注销Administrator,重新用你的用户名登录Windows 7操作系统,而后到“计算机管理器”里禁用Administrator;
6. 以管理员身份打开一个DOS窗口,输入以下命令:
rmdir "C:\Users" /S /Q
mklink /J "C:\Users" "D:\Users"

操作以上步骤,你就成功的完成Windows 7操作系统把“用户文件夹”设置在非系统盘中。

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Win10系统:该文件没有与之关联的程序来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置...
双击打不开盘符的修复方法
VB设置WebBrowser的COOKIE、临时文件夹等路径
AutoIT 设置默认浏览器
电脑慢怎样彻底清理电脑系统垃圾
清除“Recycler”病毒文件方法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服