Connecting Tech Pros Worldwide Forums | Help | Site Map

Updating PATH in DOS permanently.

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,947
#1: Sep 6 '09
Currently, to automate some laborious tasks, I'm using a batch file that runs some operations. One of those operations is to update the PATH environment variable, which will point to a drive created via SUBST (that overcomes the problem of flash drives taking up different drives on different computers). However, once the current terminal is closed, the environment variable is lost. The simple command is shown below.

Expand|Select|Wrap|Line Numbers
  1. SET PATH=%PATH%;M:\programs\PHP5.3
  2.  
So, how does one force the variable to update permanently / until computer is rebooted.

Thanks,
Mark.

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,947
#2: Sep 6 '09

re: Updating PATH in DOS permanently.


And the answer is...

Use the SETX command, instead.

Expand|Select|Wrap|Line Numbers
  1. SETX PATH "%PATH%;M:\programs\PHP5.3"
  2.  
Mark.
Reply


Similar Microsoft Windows / Vista / XP / ME / 95 & 98 bytes