See http://blogs.msdn.com/b/heaths/archive/2014/02/11/how-to-relocate-the-package-cache.aspx
(Note: If the Windows Installer file path cannot be found after Windows auto-Update, you can re-map the installer virtual disk to C:\Windows Installer in Disk Management)
Open the DiskPart tool in CMD
DiskPart
Create a virtual disk with a maximum of 16G space
Create Vdisk file= "E:\VHD\Cache.vhd" type=expandable maximum=16384
Connect and create partitions
Select Vdisk file= "E:\VHD\Cache.vhd"
Attach Vdisk
Create partition primary
Format partition, volume name package Cache, drive letter P
Format Fs=ntfs label= "Package Cache" quick
Assign Letter=p
Exit
Copy the package cache to the virtual disk you just created P
Robocopy "%programdata%\package Cache" P:\/e/copyall/move/zb
... Wait.....
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) "
View the GUID of the P-drive
Mountvol
and point to the package cache directory
Mountvol "%programdata%\package Cache" \\?\volume{xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\
Unload Drive Letter P
DiskPart
Select Vdisk file= "E:\VHD\Cache.vhd"
Select partition 1
Remove Letter=p
Exit
Boot automatically mounts virtual disks and deletes drive letter
echo Select Vdisk file=e:\vhd\cache.vhd > E:\VHD\Cache.txt
echo Attach vdisk >> E:\VHD\Cache.txt
Schtasks/create/ru system/sc onstart/rl highest/tn "Attach package Cache"/tr "%systemroot%\system32\diskpart.exe/s E:\VHD\Cache.txt "
With this method, create a C:\Windows\Installer virtual disk
Open the DiskPart tool in CMD
DiskPart
Create a virtual disk with a maximum of 16G space
Create Vdisk file= "E:\VHD\Installer.vhd" type=expandable maximum=16384
Connect and create partitions
Select Vdisk file= "E:\VHD\Installer.vhd"
Attach Vdisk
Create partition primary
Format partition, volume name package Cache, drive letter Q
Format Fs=ntfs label= "Installer" quick
Assign Letter=q
Exit
Copy the package cache to the virtual disk you just created Q
Robocopy "C:\Windows\Installer" Q:\/e/copyall/move/zb
... Wait.....
mkdir "C:\Windows\Installer"
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) "
View the GUID of the P-drive
Mountvol
and point the installer directory
Mountvol "C:\Windows\Installer" \\?\volume{xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\
Unload Drive Letter P
DiskPart
Select Vdisk file= "E:\VHD\Installer.vhd"
Select partition 1
Remove Letter=q
Exit
Boot automatically mounts virtual disks and deletes drive letter
echo Select Vdisk file=e:\vhd\installer.vhd > E:\VHD\Installer.txt
echo Attach vdisk >> E:\VHD\Installer.txt
Schtasks/create/ru system/sc onstart/rl highest/tn "Attach Installer"/tr "%systemroot%\system32\diskpart.exe/s E:\V Hd\installer.txt "
"Go" Transfer the package cache folder, transfer the Windows Installer folder