使用ramdisk内存分区给常用软件加速

::参考内存盘软件https://download.csdn.net/download/zly6tz/9717137
cls
@echo off ::内存虚拟盘符-内存盘大小自己查看源目录大小 ::下面是设置vs2008,vs插件VisualAssist,chrome,我设置的是8G,目前使用了2.3g ::此内存盘需要设置对应文件-开机时加载,关机保存即可 @SET VDisk=S: echo 正在努力工作... ::下面的项 自己按需修改 call :SRCopyMKLink "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7" "%VDisk%\vs.Common7" call :SRCopyMKLink "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC" "%VDisk%\vs.VC" call :SRCopyMKLink "C:\Users\Administrator\AppData\Roaming\Microsoft\VisualStudio\9.0" "%VDisk%\vs.Roaming" call :SRCopyMKLink "C:\Users\Administrator\AppData\Local\VisualAssist" "%VDisk%\VisualAssist" call :SRCopyMKLink "C:\Users\Administrator\AppData\Local\Google\Chrome" "%VDisk%\Chrome" @goto end ::自动备份目录 并联接 :SRCopyMKLink @set srcDir=%~1 @set toDir=%~2 @SET srcName=%~nx1 @SET toName=%~nx2 ::变态的bat,函数中的if exist路径包含括号时出鬼,只能用cd来处理 cd /d "%~dp1" if not exist %srcName%_SRBAK ( ::判断源路径是否存在 if not exist "%srcName%" ( echo 源目录不存在:%srcName% goto toerror ) rename "%srcName%" "%srcName%_SRBAK" if not exist "%srcName%_SRBAK" ( echo 修改源目录名失败:%srcName% goto toerror ) ) ::处理目标路径 if not exist "%toDir%" ( ::创建一个临时目录 md "%toDir%_tmp" xcopy "%srcName%_SRBAK\*.*" "%toDir%_tmp\" /s /e /y /h /r /Q if not %errorlevel%==0 ( echo 复制文件失败:源:%srcName% goto toerror ) ::将临时目录名修改回来 ren "%toDir%_tmp" "%toName%" if not exist "%toDir%" ( echo 修改目标路径失败:%srcName% goto toerror ) ) if exist "%srcName%_SRBAK" ( if exist "%srcName%" ( ::删除源目录名 rd /s /q %srcName% if exist "%srcName%" ( echo 删除源链接失败:%srcName% goto toerror ) ) mklink /j "%srcName%" "%toDir%" if not %errorlevel%==0 ( echo 链接失败:%srcName% goto toerror ) ) :tosuccess @exit /B 0 :toerror echo 发生了错误 @exit /B 1 :end pause

 

转载于:https://www.cnblogs.com/SilenceRet/p/9080015.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值