The idea here is to store the paging file and move temporary storage away from the system drive.

This will primarily reduce the need for defrag and create a more stable environment with regard to temporary storage.
One of the most annoying things with Windows is its inability to handle low diskspace in a sane manner.

Quick description:
Before doing changes; take note what the settings are and
make sure to CLEAN OUT the CURRENT files and dirs – likely necessary to regain that space.

Right click on “My computer”, select “Properties”. In the dialog, click on the “Advanced” tab, then on “Settings” under “Performance”. A new dialog and a new “Advanced” tab, click on “Change” under “Virtual memory”.
Set at least one new paging file on any disc not equal to the SYSTEMDRIVE (e.g. C:) ; click on the drive, set parameters, click on “Set”. As you have done so, it is possible to remove the paging file from the SYSTEMDRIVE by; click on the drive, click on “No paging file” and “Set”.
Exit the open dialogs by clicking OK on them (you will be asked to reboot).
After the reboot, check to see if the paging file was deleted, delete it if not.

The temporary storage location can be moved out of the system drive thus:
Open the first dialog the same way as described above. Click on “Environment Variables” in the lower part, a new dialog opens.
The upper part holds defintions PER USER, the lower part for the SYSTEM.
If you have an F: -drive sane settings for these might be these:



Remember to CREATE the necessary directories! Reboot.
After the reboot, check to see if there remains files in the previous temporary file directory, delete all files.

Directories that can be emptied with a single Explorer window open
(XP specific? These can hold huge amounts of abandoned files)

%USERPROFILE%\Local Settings\Temp
%USERPROFILE%\Local Settings\Temporary Internet Files

(you can actually type these, as shown, into the address field of Explorer)

A good way to create a list of directories that MAY need a cleanup (added 2010-07-04)
Hold left Windows key and hit R, type “cmd” (no quotes) and hit Enter, then go on typing as indicated on the following lines. Hit Enter on every line, wait for the prompt to reappear before typing again. This example is from an XP+SP3 machine:

Note that “USERNAME” will be your login name.

C:\Documents and Settings\USERNAME>
C:\>dir %SYSTEMDRIVE%\ >ListOfDirs.txt /s /ad /b
C:\>dir %SYSTEMDRIVE%\ >ListOfFiles.txt /s /a-d /b
C:\>find "cache" /i ListOfDirs.txt  > Suspects.txt
C:\>find "temp" /i ListOfDirs.txt   >> Suspects.txt
C:\>find "cache" /i ListOfFiles.txt >> Suspects.txt
C:\>find "temp" /i ListOfFiles.txt  >> Suspects.txt

The “Suspects.txt” file contains selected lines from the other files.
There also is two other files “ListOfDirs.txt” and “ListOfFiles.txt” in your personal “%USERPROFILE%” directory (you can actually type it as shown between the quotes into the address field of Explorer). Have a look in them. Most importantly; investigate the directories listed in the Suspects.txt file, there might be reason to clean the contents, or make the related software use a direcory on another drive – or something similar.

Some software has its own TEMP -pointers.
This is the case for e.g. Photoshop (Edit > Preferences>Performance and Camera Raw) – using Bridge? There too!,
PTGui (Tools > Options > Folders and files)  and probably some more. 

Longer description with screenshots, step by step:

  • Hold down Left Windows key and hit E, an explorer window will open.
  • Click on “Folders” if the left panel isn’t visible.
  • Now right click on “My computer”

  • A menu that looks similar to this will pop up:

  • Select “Properties”,
  • in the dialog that appears, click on the Advanced tab, then on the “Settings” button under “Performance”

  • A new dialog opens
  • Click on “Change” under “Virtual memory”, yet another dialog will open.
  • Here one can define where one or more paging files should be stored.
  • There has to be at least one, and
  • all that exist should have the total size displayed to the right of  “Recommended”.
  • As shown above the partition “SWAPFILE”  is used for a single big paging file (the entire Z: drive actually is reserved for this, it is a bit bigger than required).
  • To get it to look like this on your computer:
  • Click on the volume label for the drive where you want the paging file.
  • Click at “Custom size” or “System managed”
  • For Custom size you have to define a size, use the recommended size, or slightly more, for a single paging-file.
  • When you have defined one extra paging file…
  • you can click on the system drive and then “No paging file”
  • Click “OK” to close all dialogs… unless you wish to set the storage for temporary files…

  • To define where temporary files should be stored:
  • It starts in the same first dialog above, but in the lower part of it, which looks like this:
  • Click on “Environment Variables”, a new dialog opens
  • Find “TEMP” and “TMP” in the UPPER part, these are the USER TEMP storage definitions.
  • Find “TEMP” and “TMP” in the LOWER part, these are the SYSTEM TEMP storage definitions.
  • Use “Edit” after clicking on one of them to change; make sure the directory you define exist.
  • These can be set to the same e.g. “F:\TEMP” – given that the directory exists, and that it is a HOME computer
  • (Doing this at work could compromise security).
  • More, normal settings in a security-requiring network:
  • In the screenshot above the SYSTEM variables show how the USER variables could be defined to reside in per user directories.
  • The same doesn’t work for the SYSTEM variables, that is why they read as they do in the value column…
  • You have to write a literal instead of the “%USERNAME%”-part: e.g. F:\TEMP\SYSTEM\ – and then make sure that dir exists.
  • Click “OK” to close the dialogs, a reboot is required for the changes to take effect fully (restarting software might be enough).
  • Advertisements