— tomauger.com

Creative Suite issues with relocated TEMP folder

Here’s the scenario: you have a smaller Solid-state drive as your boot and application drive, and a larger HDD for your files. You don’t want to gum up your SDD with temporary internet files and other cruft, so you want your TEMP directory to be on the HDD, rather than its default location in Users. In fact, you don’t even want your Users to be on your boot drive either, because that’s where My Documents and other libraries are stored by default.

The solution? Move Users to your data drive but create a HARD LINK on your boot drive to fool windows (and Adobe Creative Suite) into thinking that everything’s on the boot drive.

One additional note (that caused a major complication for me) was that I generally like my TEMP directory to be at the root of my drive. This makes it more visible and therefore more likely to get cleaned out (by me) regularly, as opposed to being buried inside my %USERPROFILE% directory where it will never see the light of day. This has always been C:\TEMP in the past, but under this setup, I wanted it on D:\TEMP.

It turns out that moving your Users to the data drive is easier than you might think. The additional complication is that you can’t be logged in as that user when you do it. The best option then is to boot from your Windows install disk (which should be handy, because in all likelihood you’re doing this right after a clean install of Windows, right?) and do it from a command prompt there.

Before we get started

One thing you might want to do is get your drive letters in order now, before you do any hard-linking, because experience shows that changing drive letters after the fact could be problematic.

Boot into Windows, and open up the D

Booting to a command prompt

Use your Windows install disk to boot to a command prompt. To get there, choose the repair your computer option. You get this scary message saying that windows has detected a problem with your install (this is not true) and do you want to “Repair and Restart”. NO. (Go ahead, click the “No” button).

In the list of recovery tools, there is your command prompt. Click it.

Moving USERS to your secondary drive

Now that you’re in a command prompt and not logged in as a User, you can move the Users directory. There’s a ton of hidden files and stuff, so we’ll be using robocopy, a powerful copy tool that’s bundled with Windows 7.

This is where things get a little weird. When in Recovery mode, your logical drive letters can be different than what you expected. So spend some time in your command prompt to discover which is which.

I recommend using the DISKPART utility, which is available at the command prompt. Type “DISKPART” (without the quotes of course, and capitalization is optional) then type “list volume”, yes, I know it’s grammatically incorrect Niles. Now you should see a listing of all your volumes with the drive letters they’re mapped to. Look at the drive sizes – hopefully that will help identify the drive. Type “exit” to return to your command prompt for the next step.

If that should fail to be conclusive you willhaveto rock it old skool. You will use the dir command to list the contents of your various drive letters. You type the drive letter followed by a colon (eg: C:) and then ENTER to switch drives. You might find that some drives are unavailable or are protected system partitions. Just start at C: and work your way through the alphabet, doing a dir each time you actually get a physical drive and determine which is your boot drive and which is your data drive.

You’ll know you found your boot drive when the dir command lists directories such as “Program Files”, “Windows” and “Users”.

Write these letters down. You might get confused because they are often quite different than what you would expect. When this process is complete, they will go back to normal, so just bear with me.

In my scenario, it turned out that my boot drive was E: and my data drive was D:, so those are the letters I used in the following commands.

1. Copy your Users directory from the boot drive to the data drive

robocopy /copyall /mir /xj E:\Users D:\Users

2. Remove the old Users directory (it can’t be there or you can’t create the hardlink)

rmdir /S /Q E:\Users

3. Create the hardlink (called a Junction in proper NTFS jargon). This is like a shortcut, only at a file system level.

mklink /J E:\Users D:\Users

Now reboot and navigate to your Data drive – you’ll see the Users there. Then, to test it out, open up another windows explorer window, and click on Documents, and put something there.

Important: Windows Explorer will show C:\Users\YourUserName because we’ve completely fooled it. Don’t take my word for it. Navigate manually to your data drive and open up Users/YourUserName/Documents and you should see the file you copied.

For more details on the various commands I’ve listed and to see my original reference, follow this link to lifehacker.com.

Photoshop Scratch Disk Errors with relocated TEMP file

In theory, if you haven’t messed with your TEMP folder, it will be %USERPROFILE%\AppData\Local\Temp. Which means that it’s been relocated, too. In my case I moved my TEMP file to D:\TEMP for the reasons I described above in my preamble. This required also going into the Windows environment variables and pointing the TEMP directory to this new location. This is actually easy to do via Start Menu > Search > View Advanced Systems Settings, then click on Advanced > Environment Variables. You can then edit each occurrence of TMP and TEMP to point to your new location.

This causes no end of grief for the Adobe Creative Suite applications.

Photoshop will fail on launch giving you this error: “Could not open a scratch file because the file is locked or you do not have the necessary access privileges”

(Aside: for you Googlenauts who just landed on this page because you’re having this error, you might want to try trashing your prefs by holding down Ctrl + Alt +Shift immediately after launching Photoshop. That is the recommended fix for a different, and much more common situation, that also leads to the same error message. The solution below only applies if you’ve moved your TEMP folder to another location).

Bridge will crash shortly after launch with a similar scratch disk error.

InDesign will crash a moment after it boots up.

It’s bad.

It’s actually bad design on Adobe’s part. They don’t respect the environment variable and for some bizarre reason need the TEMP folder to be on the boot drive.

The solution: create another hardlink to TEMP.

mklink /J C:\TEMP D:\TEMP

Then point the environment variables to the hardlink, not to the physical location. Open your Start Menu, right click Computer, choose Properties. Click “Advanced System Settings” in the top left navigation pane. Choose the Advanced tab and click “Environment Variables”. Now, look in both the User Variables and the System Variables for any occurrence of “TEMP” or “TMP” and press the corresponding Edit button. Type in C:\TEMP in each instance (there are usually 4 edits that need to be made).

Leave a comment if this worked for you!

Note: I’m not a systems guy, so if you have other issues I probably don’t have the answers. I’m just posting this here because it took me a lot of Google-fu to cobble this info together, and the hardlink to TEMP is something I came up with (though I’m sure others have, too).

  • http://jon.dunfee.net/ Jon Dunfee

    I ran into the scratch disk issue with Photoshop; the interwebs brought me to your blog post and I appreciate your share of frustration and solution. I did a fresh install of windows using the Sysprep route for relocating the users folder without junctions. http://tinyurl.com/a76qgwa Typical for Adobe to ignore system settings.

  • Jan

    Thanks a lot, this seems to be the only webpage with a working solution!
    The hardlink creation to TEMP did the trick.

    The other options did not work.

    Saving to pdf while without the preserve editing capabilities is no option.
    Running Photoshop as administrator will allow you also to save to pdf, but the drag&drop will not work anymore.

  • Small builder

    My solution was just to boot up photoshop once in administrator mode, go to preferences and change scratchdisk to D:/ . Same story for Illustrator and Indesign and all other adobe apps that use temporary files / scratch disks. An easy win.

  • Hieronymus P. Organthruster

    This worked for me, though I had to work through a problem with the User Profile Service. The problem is from this portion of your text:

    “When in Recovery mode, your logical drive letters can be different than what you expected.”

    When I started Recovery Mode, my system drive remained C: but data drive became E: where it is normally D:. So what I did was:

    mklink /J C:Users E:Users

    The problem here is that in creating a junction point to E:, the junction pointed to a non-existent drive letter when Windows was booted normally and the User Profile Service generated the following error:

    The User Profile Service service failed the logon.

    Short answer: don’t panic. To work around this, you need to visit the Microsoft KB page on this particular topic:

    You receive a “The User Profile Service failed the logon” error message

    Follow Method 1 by running the Registry Editor in Safe Mode and following the steps. When logging in, Safe Mode recognises that the User Profile you are trying to start is in a nonexistent location and helpfully creates a temporary user instead with its profile in the following location:


    (When opening an Explorer window you will receive errors about the desktop being inaccessible, but you can safely dismiss them.)

    Now, because you are logged in as this temporary systemprofile user, you are able to delete the misdirected junction points and recreate them to the correct drive letter by opening C:WindowsSystem32cmd.exe and running mklink again:

    mklink /J C:Users D:Users

    No need to mess around with the Recovery Mode. Just reboot, job done.

    Incidentally, having updated my Environment Variables to point to the junction points, Adobe Photoshop works as expected without the need to run it as administrator. This has frankly changed my life as I can drag and drop files etc. whereas previously the elevated permissions meant I could not.

    The boneheads at Adobe make their software worse with each release, refuse to fix big issues such as this one, and thousand of us lost the faith some while back. Their business now relies on the fact there is no competition – should be fun for them when there is some, eh!

  • http://www.tomauger.com Tom Auger

    Thanks for the detialed info, HPO. I had the same issue as you, up to a point, but when I rebooted, the drive letters “sorted themselves out” – and this has been the experience of others as well, so I’m not sure what’s different. I’m really glad you took the time to post the additional information for anyone that does experience the same issues that you did.

    As for your assessment of Adobe – I am 100% on-board with your comments.

  • http://twitter.com/Terry_McGarry Terry McGarry

    This worked perfectly for me. Thank you for posting.

  • Thegrop

    It worked great for me!

    I could open Photoshop since I had changed the scratch disk location, but I had to face the problem again today while exporting a PDF. Also, it’s been 3 months I had to work on InDesign on another computer, without know how to solve this problem…

    So, thanks a lot :)

  • Allie

    This worked when I had already given up all hopes.

    Thanks a lot!