• 【转】转移Package Cache文件夹,转移Windows Installer文件夹


    详见http://blogs.msdn.com/b/heaths/archive/2014/02/11/how-to-relocate-the-package-cache.aspx

    (注意:若Windows自动更新之后导致Windows installer文件路径找不到,可以在磁盘管理中,重新把installer的虚拟盘映射到C:Windows installer)

    在CMD打开diskpart工具

    diskpart

    创建一个最大为16G空间的虚拟磁盘

    create vdisk file="E:VHDCache.vhd" type=expandable maximum=16384

    连接并创建分区

    select vdisk file="E:VHDCache.vhd"

    attach vdisk

    create partition primary

    格式化分区,卷名Package Cache,盘符P

    format fs=ntfs label="Package Cache" quick 

    assign letter=P

    exit

    拷贝Package Cache到刚创建的虚拟磁盘P中

    robocopy "%ProgramData%Package Cache" P: /e /copyall /move /zb

    ...等待.....

    mkdir "%ProgramData%Package Cache" 

    echo y | cacls foo /s:"O:BAG:DUD:PAI(A;OICIID;FA;;;BA)(A;OICIID;FA;;;SY)(A;OICIID;FRFX;;;BU)(A;OICIID;FRFX;;;WD)"

    查看P盘的GUID

    mountvol 

    并将Package Cache目录指向

    mountvol "%ProgramData%Package Cache" \?Volume{xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

    卸载盘符P

    diskpart

    select vdisk file="E:VHDCache.vhd" 

    select partition 1

    remove letter=P

    exit

    开机自动挂载虚拟磁盘,并删除盘符

    echo select vdisk file=E:VHDCache.vhd > E:VHDCache.txt

    echo attach vdisk >> E:VHDCache.txt

    schtasks /create /ru system /sc onstart /rl highest /tn "Attach Package Cache" /tr "%SystemRoot%System32diskpart.exe /s E:VHDCache.txt"

    同以此方法,创建C:WindowsInstaller的虚拟磁盘

    在CMD打开diskpart工具

    diskpart

    创建一个最大为16G空间的虚拟磁盘

    create vdisk file="E:VHDInstaller.vhd" type=expandable maximum=16384

    连接并创建分区

    select vdisk file="E:VHDInstaller.vhd" 

    attach vdisk

    create partition primary

    格式化分区,卷名Package Cache,盘符Q

    format fs=ntfs label="Installer" quick 

    assign letter=Q

    exit

    拷贝Package Cache到刚创建的虚拟磁盘Q中

    robocopy "C:WindowsInstaller" Q: /e /copyall /move /zb

    ...等待.....

    mkdir "C:WindowsInstaller" 

    echo y | cacls foo /s:"O:BAG:DUD:PAI(A;OICIID;FA;;;BA)(A;OICIID;FA;;;SY)(A;OICIID;FRFX;;;BU)(A;OICIID;FRFX;;;WD)"

    查看P盘的GUID

    mountvol 

    并将Installer目录指向

    mountvol "C:WindowsInstaller" \?Volume{xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

    卸载盘符P

    diskpart

    select vdisk file="E:VHDInstaller.vhd" 

    select partition 1

    remove letter=Q

    exit

    开机自动挂载虚拟磁盘,并删除盘符

    echo select vdisk file=E:VHDInstaller.vhd > E:VHDInstaller.txt

    echo attach vdisk >> E:VHDInstaller.txt

    schtasks /create /ru system /sc onstart /rl highest /tn "Attach Installer" /tr "%SystemRoot%System32diskpart.exe /s E:VHDInstaller.txt"

  • 相关阅读:
    数据库事务隔离级别
    impala jdbc4的group by语句的bug,加上limit没错
    火狐不支持innerText属性,只支持innerHTML属性
    struts2.x + Tiles2.x读取多个xml 配置文件
    ids for this class must be manually assigned before calling save():Xxx
    整合ssh model $$_javassist_13 cannot be cast to javassist.util.proxy.Proxy
    火狐点击链接请求两次的问题
    C++——类和动态内存分配
    C++——使用类
    C++——对象和类
  • 原文地址:https://www.cnblogs.com/yulinlover/p/5980438.html
Copyright © 2020-2023  润新知