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

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 09:05 AM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33