1
This is a follow-up to Set Permanent Environmental Variable in Windows XP.
I want to change System variables in XP through running a bat file. But when I run it I get the error "Too many command-line parameters"
This is the code:
set KEY="HKLM\SYSTEM\CurrentControlSet\Control\Sessions Manager\Environment"
set PATHxx=%Path%
reg add %KEY% /v Pathx /t REG_EXPAND_SZ 5 /d %PATHxx%
How can I fix this?
but still i get the error
Too many command-line parameters – e.hunnigton – 2010-04-27T11:32:47.597
I've updated my answer... – Shevek – 2010-04-27T12:00:48.450
I've updated again! – Shevek – 2010-04-27T12:09:48.897
hello, now it don't get the error, and it says
The operation completed successfully
But the environment variable Pathx is not created in Computer--> properties --> Advanced -->Environment Variables --> System Variables – e.hunnigton – 2010-04-30T04:23:06.750
@shyameniw - I think it's a permissions thing specific to that part of the registry. My testing did not allow me to create the key in that location but did elsewhere in the registry. Try a test to
HKLM\SOFTWARE\SuperUser
instead and check in Regedit to see if that created. – Shevek – 2010-04-30T05:53:47.813