I have a batch file "file.bat" that will call an installer with the following command:
msiexec.exe /i "%~dp0\installer.msi"
The installer will install a program and update the Path variable. While this works fine, the problem is when I try to start the program it's not found because apparently the PATH variable was not updated. I tried restarting the batch file from within itself with:
start cmd /c file.bat
but it didn't work. Is there a way to refresh the PATH variable or maybe restart the batch file in a new process so that it detects the new environment?
PS: restarting the batch file manually works of course but it's not what I want.
Thanks.
set path=%path%;C:\Some other folder
– TurmoilPATH
value just modified by the installer directly from registry either with command reg or with command setx and update/replace localPATH
with new systemPATH
. See for example answer on Why are other folder paths also added to system PATH with SetX and not only the specified folder path? how to get systemPATH
directly from registry. – Amiss