Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Setting the PATH variable with WHS

Hi,
Is it possible to set the environment variable PATH using Windows Script Host technology. I mean to set the PATH from VBScript or JScript? I need to set it explicitly for the whole system, not just for the script runtime environment.

regards,
M
0
minstn
Asked:
minstn
  • 2
1 Solution
 
pbarretteCommented:
Hi M,

I just saw this recently:

var WshShell = WScript.CreateObject("WScript.Shell");
var WshSysEnv = WshShell.Environment("SYSTEM");
WshSysEnv.Item("PATH") = "C:\MyPath";

pb
0
 
pbarretteCommented:
Hi Minstn,

Ouch. A B-grade? What was wrong with the answer?

pb
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now