Re: Resetting PATH (system env.) during startup

From: Jerold Schulman (Jerry_at_jsiinc.com)
Date: 02/10/05


Date: Thu, 10 Feb 2005 10:43:24 -0500

On Thu, 10 Feb 2005 15:03:47 +0100, hallstein <hallstein@online.yahoo.com> wrote:

>I've created a Group Policy (Computer Conf. \ Windows Settings \ Scripts
>\ Startup )
>
>Some computers of mine have been applied a .MSI that destroyed the PATH
>variable, thus some programs stopped working.
>
>------------------------------------------------------------------
>RESETPATH.CMD
>@echo off
>REM Fixes path:
>echo %path% | %windir%\system32\find /I "SYSTEM32" >nul
>IF %errorlevel% == 1 goto setpath
>goto continue
>
>:setpath
>PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;%PATH%
>
>:continue
>REM (Continue startup script)
>------------------------------------------------------------------
>
>However this script does not seem to fix the path variable. Anybody know
>why? is it not allowed to change path from startup scripts?

The above just changes the variable temorarily in the script.
To change it, you must eddit the registry Value Name "PATH"
at the "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" sub-key.

You can use reg.exe , built into Windows XP, Windows Server 2003, and later,
 or installed from Windows 2000 Support Tools.

or try using FixPath.exe from tip 8368 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com



Relevant Pages

  • Re: startup script on winxp
    ... network at comptuer startup and logon," as an option in Computer ... do not detect slow network connections ... maximum retries to unload and update user profile ... I'm not sure if that effects the startup script however. ...
    (microsoft.public.scripting.vbscript)
  • Re: startup script on winxp
    ... network at comptuer startup and logon," as an option in Computer ... do not detect slow network connections ... maximum retries to unload and update user profile ... I'm not sure if that effects the startup script however. ...
    (microsoft.public.win2000.group_policy)
  • Re: startup script on winxp
    ... network at comptuer startup and logon," as an option in Computer ... do not detect slow network connections ... maximum retries to unload and update user profile ... I'm not sure if that effects the startup script however. ...
    (microsoft.public.windows.group_policy)
  • Re: Startup Items
    ... click a button to list all startup programs that begin with that letter ... And for comprehensive information about Microsoft Windows Services ... System Services for the Windows Server 2003 Family and ...
    (microsoft.public.windowsxp.newusers)
  • Intermittent slowness in Office programs
    ... I'm having a problem on a new Windows Server 2003 system where Word, Excel, ... and Powerpoint all startup slow quite often. ... the delay ...
    (microsoft.public.office.misc)