I have borrowed a laptop with Windows XP from a company that I will do a project for. They say that I have almost Admiinistrator rights on the computer so that I can install software.

Now I have installed a few development tools, but I need to add a few things to the PATH environment variable. But I don't seem to have permissions to edit the PATH environment variable. Is there any way I could workaround this? Could I create a personal environment variable PATH that is used instead?

link|improve this question

feedback

2 Answers

up vote 0 down vote accepted

I'm not sure about whether your rights will allow it but you can try setting the path for a command window with path = %PATH%;newdir; if it works, it will last until the command window is closed. This may be ok for you if you are mostly working at the command line.

There is also the setx tool that you could try if your rights allow you to install it.

Here is some additional information about the environment variables that may prove useful.

link|improve this answer
I tried this and tested setx but I got this message: Access is denied. I don't think it's possible to fix this. I have to contact the company. Thanks anyway. – Jonas Sep 17 '10 at 8:26
The correct syntax in cmd shell is set path=%path%;newdir - note the set prefix and no whitespace around = – grawity Sep 17 '10 at 13:47
@grawity The set is deliberately missing. Jonas explained in the question that he wasn't allowed to use set to set the path. I wasn't sure where the block came in so I was pointing out a way to change the path for the current command window, with the hope that this might not be prevented by the lack of admin rights. I didn't bother listing the standard methods of changing the path because I read the question which told me they didn't work. – Neal Sep 18 '10 at 1:03
1  
The question does not mention set anywhere. There's more than one way of editing environment; maybe Jonas was talking about the GUI. (Besides, it is not possible to disable the set builtin except by patching cmd.exe, and even then there are many ways to get around it.) – grawity Sep 18 '10 at 19:39
feedback

Yes, you can create your own environment.

  • GUI:
    • System Properties -> Advanced -> Environment Variables
    • Click Add, enter PATH as name and %PATH%;mynewdir as value.
    • This is the only method that ensures instant availability to all future processes launched by Explorer, without the need to re-login.
  • Kinda GUI:
    • regedit -> HKEY_CURRENT_USER\Environment
    • Right-click, New -> Expandable String Value
  • CLI:
    • reg add hkcu\environment /v PATH /t reg_expand_sz /d %%PATH%%;mynewdir
    • Doubled %% is required to prevent %%PATH%% from being expanded by shell.
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.