2

I am trying to modify my system Path value. I need this as I am doing an upgrade of the S/W and the users need to have access to the old and new system. I provide them with a toggle button which will change the settings and let them use both.

One of the things I need to do for this is change the system path value. I have a .reg file to do this. When I run this script, I get the message "The keys and values contained in have been successfully added to the registry"

But I do not see the change reflected when I go and check my registry.

My Original value for System Path is:

C:\Oracle01\product\11.2.0\client_1\bin;C:\Program Files\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Infor\Unify\Runtime52\;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\

My reg file is as below


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"Path"="REG_EXPAND_SZ:C:\Oracle01\product\11.2.0\client_1\bin;C:\Program Files\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Visual\RunTime40\;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\"

I want entry C:\Infor\Unify\Runtime52\ to change to c:\Visual\RunTime40\ in the path.

Pls let me know what I am missing here. My reg file is in my local C drive.

Thanks, Vidya.

| improve this question | | | | |
  • I might be misunderstanding the situation here but can you not edit or add new environmental variables? – Samuel Nicholson Jul 10 '14 at 14:13
  • 1
    system path or registry key? they are very different, one you do via regedit <file>.reg and the other via SET – Quijote Shin Jul 10 '14 at 14:32
  • I want to edit the system Path. I tried changing the registry for it. – Vidya Jul 10 '14 at 15:28
  • I finally tried this and it worked. SETX -M PATH "C:\Oracle01\product\11.2.0\client_1\bin;C:\Program Files\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Visual\RunTime40\;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\" I now want to put this in a batch file. – Vidya Jul 10 '14 at 15:29
0

As in comments

To change your local paths you do it via console, you use SET commands, so with it you can

View your available enviroment variable list

SET

Create a new env variable

SET newenv=hello;

Update a variable

SET newenv=%newenv%cya;

Can pint it out

echo %newenv%
SET %newenv%

At system registry keys

you can

registry /s <file>.reg

/s is for silent.

| improve this answer | | | | |
  • I finally tried this and it worked. SETX -M PATH "C:\Oracle01\product\11.2.0\client_1\bin;C:\Program Files\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Visual\RunTime40\;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\" – Vidya Jul 10 '14 at 15:33
  • I now want to put this in a batch file. I have admin rights , so I did not have to run as admin. In case of other users without admin access will this work? – Vidya Jul 10 '14 at 15:33
  • can't accurate it , anyway I can't understand your environment. You seems to be at an enterprise network, If so , as domain admin you can remote execute everything – Quijote Shin Jul 10 '14 at 15:49
  • You can see answers to this [question].(superuser.com/questions/758950/…) and this(superuser.com/questions/284342/…) – Wishwas Jul 10 '14 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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