修改系统目录

2016年1月13日 0 条评论 634 次阅读 0 人点赞

把常用系统目标转移到非系统盘,重装的时候再次运行此脚本,装完后即恢复安装前桌面(可以添加相关命令,将现有目录中的文件转移到目标文件夹中)

@echo off
setlocal enabledelayedexpansion
title 系统目录修改 10:19 2014年1月8日 [email protected]

::下载
set "{374DE290-123F-4565-9164-39C4925E467B}=F:\TDDOWNLOAD"
md "%{374DE290-123F-4565-9164-39C4925E467B}%" >nul 2>nul
::应用数据
set "AppData=D:\Documents\Roaming"
md "%AppData%" >nul 2>nul
::IE 缓存
set "Cache=D:\Documents\Temporary Internet Files"
md "%Cache%" >nul 2>nul
::Cookies
set "Cookies=D:\Documents\Cookies"
md "%Cookies%" >nul 2>nul
::Desktop
set "Desktop=D:\Documents\Desktop"
md "%Desktop%" >nul 2>nul
::Favorites
set "Favorites=D:\Documents\Favorites"
md "%Favorites%" >nul 2>nul
::History
set "History=D:\Documents\History"
md "%History%" >nul 2>nul
::我的文档
set "Personal=D:\Documents"
md "%Personal%" >nul 2>nul
::Local AppData
set "Local AppData=D:\Documents\Local"
md "%Local AppData%" >nul 2>nul
::My Music
set "My Music=G:\My music"
md "%My Music%" >nul 2>nul
::My Pictures
set "My Pictures=F:\Documents\My Pictures"
md "%My Pictures%" >nul 2>nul
::My Video
set "My Video=F:\movie"
md "%My Video%" >nul 2>nul


set "reg_=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
set "name_={374DE290-123F-4565-9164-39C4925E467B} AppData Cache Cookies Desktop Favorites History Personal"
for %%i in (%name_%) do reg add "%reg_%" /v %%i /t REG_EXPAND_SZ /d "!%%i!" /f
reg add "%reg_%" /v "Local AppData" /t REG_EXPAND_SZ /d "%Local AppData%" /f
reg add "%reg_%" /v "My Music" /t REG_EXPAND_SZ /d "%My Music%" /f
reg add "%reg_%" /v "My Pictures" /t REG_EXPAND_SZ /d "%My Pictures%" /f
reg add "%reg_%" /v "My Video" /t REG_EXPAND_SZ /d "%My Video%" /f
pause

goto :eof

Sevenfal

这个人太懒什么东西都没留下

文章评论(0)