General discussion


Environment Variable

By EdLockett ·
Need to set a system environment variable on 20 workstations. The value of the variable is the same in each case. Does anyone know of a way I can set this without having to log on locally at each workstation?
I have tried using the following technique:
Copy a batch file to c$\windows on the target machine.
Use psexec to execute this batch file
the batch file contains the command
'set variable_name=value'
Although psexec reports that the batch file exited on the target machine with error code 0 the variable is not available on the target machine.
Any help with this would be most appreciated. I would be interested to hear of other possible methods for accomlishing this. There must be a way to do this successfully!
Thanks in advance.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by lowlands In reply to Environment Variable

your method will only work for the batch script executing. It is not a persistent setting

The environment variables ar all stored in the registry.

You could create a .reg file and then use psexec to run it on the remote machine

Look for the environment variables under:
HKLM\System\CurrentControlSet\Session Manager\Environment.

There are several other methods to remotely enter info in the registry. Let me know if you need more info

Collapse -

by EdLockett In reply to

Thank you very much. I was able to use a set command to make the necessary additions to the registry remotely. Spot on!

Collapse -

by EdLockett In reply to Environment Variable

This question was closed by the author

Related Discussions

Related Forums