SETX不会将路径追加到系统路径变量 [英] SETX doesn't append path to system path variable

查看:729
本文介绍了SETX不会将路径追加到系统路径变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过下面的命令通过批处理文件附加一些路径到系统路径变量:

  setx PATH%PATH %; C:\Program Files\MySQL\MySQL Server 5.5 \bin

在运行上面的批处理文件之后检查系统变量路径,上面的路径不在那里。





可以看到所有窗口变量值内容如下:

  C:\程序文件(x86)\AMD APP\bin\x86_64; C: \Program Files(x86)\AMDAPP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1 .0 \; C:\ProgramFiles(x86)\ATI Technologies \ATI.ACE\Core-Static; 

我做错了什么?



如果你想改变系统级别的代码,广泛的环境变量,您必须使用 / M

  setx PATH%PATH %; C:\Program Files\MySQL\MySQL Server 5.5\bin/ M 

setx.exe是关于/ M,BTW的放置。它需要在结束。


I have tried below command to append some path to system path variable by batch-file :

setx PATH "%PATH%;C:\Program Files\MySQL\MySQL Server 5.5\bin"

I have checked system variable path after running above batch-file, above path isn't in there.

You can see all windows Variable value content in below :

C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMDAPP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\ProgramFiles (x86)\ATI Technologies\ATI.ACE\Core-Static;

What am i doing wrong?

解决方案

To piggy-back on @Endoro's answer (I lack the rep to comment):

If you want to change the system-wide environment variables, you have to use /M, a la:

setx PATH "%PATH%;C:\Program Files\MySQL\MySQL Server 5.5\bin" /M

setx.exe is picky about placement of the /M, BTW. It needs to be at the end.

这篇关于SETX不会将路径追加到系统路径变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆