Follow

How to redirect %temp% and %TMP% away from ProfileDisk to prevent unnecessary ProfileDisk growth

Product Version: 6.x

Expires on: 365 days from publish date

Updated:November 14, 2018

 

Problem:

ProfileDisk VHD or VMDK grows ins size exponentially because of large directory:

c:\users\ProfileDisk\user_name\AppData\Local\Temp 

Symptoms:

Large profiledisk for users utilizing non persistent VM desktops. 

Possible Resolution(s): 

ProfleUnity can redirect %temp% and %tmp% to a local share thus when the VM is refreshed it is deleted. 

To address this issue create 4 Application Launcher rules:

Application Launcher Rule 1) Creates ProfileDisk_Temp directory

  • Filespec: %systemroot%\system32\cmd.exe
  • Arguments: /c if not exist "%systemdrive%\ProfileDisk_Temp\%username%" mkdir "%systemdrive%\ProfileDisk_Temp\%username%"
  • Timing: During Configuration Execution
  • Hide Progress: True
  • Run Async: False

Application Launcher Rule 2) Hides the "ProfileDisk_Temp" directory from user

  • Filespec: %systemroot%\system32\cmd.exe
  • Arguments: /c attrib +H "%systemdrive%\ProfileDisk_Temp"
  • Timing: During Configuration Execution
  • Hide Progress: True
  • Run Async: False

Application Launcher Rule 3) Redirects variable "%TEMP%" to "ProfileDisk_Temp" directory

  • Filespec: %systemroot%\system32\cmd.exe
  • Arguments: /c REG ADD HKCU\Environment /v TEMP /t REG_EXPAND_SZ /d %systemdrive%\ProfileDisk_Temp\%username% /f
  • Timing: During Configuration Execution
  • Hide Progress: True
  • Run Async: False

Application Launcher Rule 4) Redirects variable "%TMP%" to "ProfileDisk_Temp" directory

  • Filespec: %systemroot%\system32\cmd.exe
  • Arguments: /c REG ADD HKCU\Environment /v TMP /t REG_EXPAND_SZ /d %systemdrive%\ProfileDisk_Temp\%username% /f
  • Timing: During Configuration Execution
  • Hide Progress: True
  • Run Async: False

Example:

Note: All 4 rules are available for import at the bottom of the article.

(Application Launcher>Lighting button>Import)

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.