Hi there I want to update Path
environmental variable through PHP
script. I have generated a .reg
file using PHP
. The content of reg
file looks like
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
'PATH'='c:/abc/test/ImageMagick-6.7.8-Q8/convert.exe'
When I run this file, at last step I face a error pop displaying
Cannot Import c:\User\qarni\downloads\13633555989_.reg: The specified file is not a registry script. You can only import binary registry files from within the registry script
I have tried to do this task using setx
and my .bat file looks like
@echo off
set KeyName=Path
set KeyValue="D:\songs;%PATH%"
setx %KeyName% %KeyValue%
This files runs and create a path variable in user variables not in system variable.
Can any body guide me about this error and how to handle this situation?
Best Regards