Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: set "My Documents" env var temporarily for a certain GUI program?

05 Jun 2011   #1

win7pro 64bit
set "My Documents" env var temporarily for a certain GUI program?

Ok, I know, I can change/set environment variables through
Control Panel--->System

The current environment variable values are fine for most of my programs.

However there is one program which puts some config files into the folder which is currently defined as user variable "My Documents".
I don't want that. I want to define my own, different folder for these files.
And I don't want to change always the general environment variables in "System" dialog.

Unfortunately there is no setting in the program in question to define a different location.

So is there another smart way of temporarily, externally changing the environment variable for ONE particular GU based program?

I could imagine that a batch script might be suitable with the following commands:

set "My document"=D:\path\to\different\location\
start myprogram123.exe

This trick above does not work.
But is there a similar way?

Maybe there are Registry hacks which allow individual enviroment variables for ONE particular GUI programs.

Thank you

My System SpecsSystem Spec
06 Jun 2011   #2

Windows 7 Profession 64-bit

As someone who has made a career out of avoiding programming, I can tell you I find this problem very frustrating for me too because I know the inability to change those environment variables is due entirely on programmer laziness.

Me, for example, I have Windows and hardware drivers on C drive, and everything else is somewhere on D. So when I install something new, I ALWAYS select "Custom Install" so I can tell the program where on D I want it (but also so I can opt out of all the other stuff they invariably want to foist on us). I have told Windows I want my Temp Internet Files on D. Office documents, downloads, etc. are saved on D - for just about everything, the defaults have all been changed to D. And in most cases - with the better coded programs, the option to do so is provided in the installation routine.

So when a program comes along that insists on installing under C:\Program Files, I get irritated, and will look for alternatives. But sometimes, like with Belarc Advisor which insists on installing on C, well, it is such a good program, I live with it - reluctantly. Same with MSE.

With some programs you can edit the Registry, if you can find the correct entry - and that can be tricky - the data is not always obvious. And of course, just dinking with the Registry can be tricky - and dangerous - always back it up first! With some programs, the default locations are just hard-coded in the program. And unless you are a programmer and can uncompile, edit, and recompile - or whatever it is they do, you are stuck.

So - pretty much I wasted your time because for a solution to your particular issue, I got nothing. Sorry. Maybe someone else reading does and we will both learn something.
My System SpecsSystem Spec
06 Jun 2011   #3

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)

Can you please specify what program are you talking about?

You can try to run it as different user and set specific my documents folder for that user.
Run as Different User
My System SpecsSystem Spec


 set "My Documents" env var temporarily for a certain GUI program?

Thread Tools

Similar help and support threads
Thread Forum
Confused Between The Difference - "My Documents" & "Documents"-Win7?
Hello. I have been very curious for a while now and somewhat confused. This is regarding Windows 7, so if you are not using Windows 7 you may not know what I am talking about. Okay, I see in Windows 7 you have a folder called "Documents" in your start menu and when you open it, you have the...
General Discussion
Windows 7 stuck on "Welcome" screen - system restore fixes temporarily
As in title. I have an issue where the PC boots up fine, then after I log on the PC hangs up on the loading screen. I system restored from safe mode, and the issue was fixed. Two days later, the issue recurred. Again system restore fixed the problem. Any ideas how to fix it permanently? I did not...
General Discussion
Should I move "Documents" or "My Documents" folder to D partition?
G'day Folks, 1) Should I move "Documents" or "My Documents" folder to D partition? When I click on start --> documents it opens "Documents" folder which has apps-data ...etc folders.I like to be able to click on "documents" to access my data from D,is this possible? 2) just bought a new...
General Discussion
I cannot view the XP files "Desktop" "My documents"
Hi From Turkey I have a problem. I bought a new computer with windows seven Pro Here is a company and we have a domain controller. So my old computer (With windows XP Pro) was in domain. I joined in my new computer to domain. I removed the Harddisk of my old computer. and then i put it...
Installation & Setup
Can't rename "Documents" library to "Comics"
So here's what happened: I was using my "Documents" library as a shortcut to my comics folder. I did this because I wanted my comics folder to be accessible through the upper right section of the start menu. So I renamed it to "Comics", and all was well. That is, until I installed the...
"Access Denied" for "Documents and Settings"
I have tried logging on as the hidden Admin and I have checked my permissions but I still can't access this folder. I think there are some Firefox files in this folder and I need to see them. Any help? Thanks, Frank
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 13:10.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App