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


  1. Posts : 244
    win7pro 64bit
       #1

    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
    Peter
      My Computer


  2. Posts : 1,074
    Windows 7 Profession 64-bit
       #2

    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 Computer


  3. Posts : 934
    Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
       #3

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 12:35.
Find Us