I'm attempting to add VLC to the PATH variable on a Windows 7 setup, so that it can be called from cmd using vlc
vs "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"
.
Using set
, the PATH can be modified for the current instance of cmd, but I'd like this to persist through reboots, be applicable for all users on the system (if possible), and to use CLI tools native to Windows 7. I tried setx
(in both non-admin and run-as-administrator cmd windows) as referenced in this question, and rebooted. However, after running path
, the vlc path doesn't show up (in the variable string), and vlc
returns the error: 'vlc' is not recognized as an internal or external command, operable program or batch file.
Here are some snippets from the run-as-admin cmd.exe instance after reboot ... I check the path:
C:\Windows\system32>path
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\pkg-vc10-x64\GeographicLib-1.23\bin;C:\Program Files (x86)\XPlan\system;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\python27;C:\python27\scripts;C:\Program Files (x86)\QuickTime\QTSystem\
I don't see the VLC path there, so I try setx
again...
C:\Windows\system32>setx PATH=%PATH%;"C:\Program Files (x86)\VideoLAN\VLC"
ERROR: Invalid syntax. Default option is not allowed more than '2' time(s). Type "SETX /?" for usage.
Looking at the PATH, I see...
- PATH=C:\ProgramData\Oracle\Java\javapath
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files\Intel\WiFi\bin\
- C:\Program Files\Common Files\Intel\WirelessCommon\
- C:\strawberry\c\bin
- C:\strawberry\perl\site\bin
- C:\strawberry\perl\bin
- C:\pkg-vc10-x64\GeographicLib-1.23\bin
- C:\Program Files (x86)\XPlan\system
- C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
- C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\
- C:\python27
- C:\python27\scripts
- C:\Program Files (x86)\QuickTime\QTSystem\
... and checking in a regular-user cmd window, the results below ...
- PATH=C:\ProgramData\Oracle\Java\javapath
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files\Intel\WiFi\bin\
- C:\Program Files\Common Files\Intel\WirelessCommon\
- C:\strawberry\c\bin
- C:\strawberry\perl\site\bin
- C:\strawberry\perl\bin
- C:\pkg-vc10-x64\GeographicLib-1.23\bin
- C:\Program Files (x86)\XPlan\system
- C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
- C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\
- C:\python27
- C:\python27\scripts
- C:\Program Files (x86)\QuickTime\QTSystem\
- C:\Ruby22-x64\bin
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files\Intel\WiFi\bin\
- C:\Program Files\Common Files\Intel\WirelessCommon\
- C:\strawberry\c\bin
- C:\strawberry\perl\site\bin
- C:\strawberry\perl\bin
- C:\pkg-vc10-x64\GeographicLib-1.23\bin
Why can't I add a path variable to PATH via setx
? The error says the string is already there, and yet doesn't show it for either admin or standard user...
Edit to add: I also referenced this question in my original research: https://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows
setx PATH %PATH%;"C:\Program Files (x86)\VideoLAN\VLC"
)setx
command.setx
=
at some point earlier. I had caught my error there, but stackoverflow.com/posts/9546345/revisions has an error, and is the most upvoted answer from my edit-to-add reference. (stackoverflow.com/posts/28778358/revisions, the third-most upvoted answer at this time has correct syntax.) {The first reference question has proper syntax, I just missed it there.}