trying to append to our current PATH

  • Thread starter Mfitzge9 AT nycap DOT rr DOT com
  • Start date
M

Mfitzge9 AT nycap DOT rr DOT com

Hello all,

Thanks in advance. These message boards are great! I'm
not sure if I'm posting this in the correct place but here
goes.

I am trying to come up with a way to remotely append to
our existing environment variable "Path". I am trying to
get this done to about 500 pc's. I know about replacing
Path with this line "PATH = c:\test;%PATH%" but this only
changes it for that one command prompt window. I am
trying to change it perminantly for our users. Does
anyone know of a way to do this

Mike
 
W

Wadester

Mfitzge9 AT nycap DOT rr DOT com [[email protected]]
posted:
Hello all,

Thanks in advance. These message boards are great! I'm
not sure if I'm posting this in the correct place but here
goes.

I am trying to come up with a way to remotely append to
our existing environment variable "Path". I am trying to
get this done to about 500 pc's. I know about replacing
Path with this line "PATH = c:\test;%PATH%" but this only
changes it for that one command prompt window. I am
trying to change it perminantly for our users. Does
anyone know of a way to do this

The path is also stored in the registry in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment\Path. If you can remotely access the registry, this
might be a way.

ws
 
D

David Wang [Msft]

SET isn't going to do it for you as it only modifies the temporary "process"
environment and not the permanent "user" or "system" environment.

You can easily run a script to modify the user or system environment,
though. The following is JScript code to do this.

var WshShell = new ActiveXObject ("WScript.Shell");
var Env = WshShell.Environment( "USER" ); // or "SYSTEM"
Env("VAR_NAME") = "VAR_VALUE";

Obviously, these environment changes will be visible in processes started
AFTER the change -- so you *may* want to log out the user or reboot,
depending on how your program is launched.


There are many ways to remotely launch processes on a given machine.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Mfitzge9 AT nycap DOT rr DOT com" <[email protected]>
wrote in message Hello all,

Thanks in advance. These message boards are great! I'm
not sure if I'm posting this in the correct place but here
goes.

I am trying to come up with a way to remotely append to
our existing environment variable "Path". I am trying to
get this done to about 500 pc's. I know about replacing
Path with this line "PATH = c:\test;%PATH%" but this only
changes it for that one command prompt window. I am
trying to change it perminantly for our users. Does
anyone know of a way to do this

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top