All

I am trying to permanently append a value to the existing Win2K3 Servers
System Environment variable - Path

'Get the value of the PATH environment variable
DIM Shell, NewPath, OldPath
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set Shell = WshShell.Environment("SYSTEM")
OldPath = Shell("Path")
NewPath = OldPath & ";C:\Testing"
Wscript.Echo NewPath

The above script seems to work and echos out what I want the new path to be,
however this does not update the server ?

Am I missing something simple here please ?

Cheers

Sean

Re: Append entry to path system variable by Sean

Sean
Thu Aug 19 04:31:04 CDT 2004

Thought it was simple ...

Thanks for the help Tom


"Tom Lavedas" <tlavedas@hotmail.remove.com> wrote in message
news:7D1D719A-2963-4468-B13C-7E365754A675@microsoft.com...
> You left out the step of committing the change back to the environment,
> i.e.
> ...
>
> 'Get the value of the PATH environment variable
> DIM Shell, NewPath, OldPath
> Set WshShell = Wscript.CreateObject("Wscript.Shell")
> Set Shell = WshShell.Environment("SYSTEM")
> OldPath = Shell("Path")
> NewPath = OldPath & ";C:\Testing"
> ' Missing step ...
> Shell("Path") = NewPath
> ' And to prove the point
> Wscript.Echo Shell("Path")
>
> Tom Lavedas
> ===========
>
> "Sean" wrote:
>
>> All
>>
>> I am trying to permanently append a value to the existing Win2K3 Servers
>> System Environment variable - Path
>>
>> 'Get the value of the PATH environment variable
>> DIM Shell, NewPath, OldPath
>> Set WshShell = Wscript.CreateObject("Wscript.Shell")
>> Set Shell = WshShell.Environment("SYSTEM")
>> OldPath = Shell("Path")
>> NewPath = OldPath & ";C:\Testing"
>> Wscript.Echo NewPath
>>
>> The above script seems to work and echos out what I want the new path to
>> be,
>> however this does not update the server ?
>>
>> Am I missing something simple here please ?
>>
>> Cheers
>>
>> Sean
>>
>>
>>



Re: Append entry to path system variable by tommy_hlfgr

tommy_hlfgr
Wed Feb 22 15:36:19 CST 2006


Can anyone tell me the fix to this? The link that was reference is no
loner working and I am stuck in the same situation.




Tom Lavedas wrote:
> *I don't know of a COM Zip client, but I suspect I know what the
> problem is
> (if you are using the Winzip command line interface of a registered
> copy).
> See this thread, especially the latter postings:
>
>
> [url]http://www.google.com/groups?threadm=034a01c3b2d7%248a431230%24a501280a%40phx.gbl[/url]
>
> In a nutshell, the o.Exec.StdErr buffer is filling up and 'hanging'
> the
> process. The thread illustrates an approach to solving this
> problem.
>
> Tom Lavedas
> ===========
>
> "Sean" wrote:
>
> > All
> >
> > I am trying to permanently append a value to the existing Win2K3
> Servers
> > System Environment variable - Path
> >
> > 'Get the value of the PATH environment variable
> > DIM Shell, NewPath, OldPath
> > Set WshShell = Wscript.CreateObject("Wscript.Shell")
> > Set Shell = WshShell.Environment("SYSTEM")
> > OldPath = Shell("Path")
> > NewPath = OldPath & ";C:\Testing"
> > Wscript.Echo NewPath
> >
> > The above script seems to work and echos out what I want the new
> path to be,
> > however this does not update the server ?
> >
> > Am I missing something simple here please ?
> >
> > Cheers
> >
> > Sean
> >
> >
> > *



--
tommy_hlfgr
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------