Win 2K Service needs and Updated System Path and Machine Reboot

  • Thread starter Thread starter rajeesh
  • Start date Start date
R

rajeesh

Summary:-
Windows 2000 service needs an updated system path and
machine reboot

Here's the scenario we're trying (in Windows 2000):
1. Install a service during a product installation.
2. The service needs an updated system path to start/run.

Is there any way of having some kind of temporary path for
the system,
a) without updating the system path?
b) without updating the system path and requiring a
machine reboot?

Thanks in Advance,
Rajeesh
 
Summary:-
Windows 2000 service needs an updated system path and
machine reboot

Here's the scenario we're trying (in Windows 2000):
1. Install a service during a product installation.
2. The service needs an updated system path to start/run.

Is there any way of having some kind of temporary path for
the system,
a) without updating the system path?
b) without updating the system path and requiring a
machine reboot?

Thanks in Advance,
Rajeesh

Yes. You can set the path using setenv -m PATH "The new Path".
See tip 4928 in the 'Tips & Tricks' at http://www.jsiinc.com.

If the new folder is set into the folder environment variable (reg.exe is from
the support tools on the CD-ROM)

Set KEY="HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
Set prevpath=
Set newpath=
For /F "tokens=2,*" %%i in ('reg.exe Query %KEY% /v Path ^|findstr.exe /r /i
/C:"Path.*REG"') Do @Set prevpath=%%j
REM the above 2 lines is one line
If Not Defined prevpath @Echo Failed to find the path using reg.exe. & goto :end
Set newpath=%prevpath%;%folder%
Set newpath=%newpath:;;=;%
Echo %prevpath%|findstr.exe /i /C:"%folder%" >NUL
If %ErrorLevel% NEQ 0 setenv -m PATH "%newpath%"


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top