I was setting path for MinGW in environmental variable , double clicked the "path" variable in User variables and rename it as "Path" and set the values to "C:\MinGW\bin;C:\MinGW\msys\1.0\bin;", still by typing g++ it showing 'g++' is not recognized as an internal or external command,
operable program or batch file. Now my previous "path" and its values are replaced by "Path". All my Program Files paths are removed . Maybe I am unable to explain the situation properly...hope u help.
Related
a question regarding messing with Windows Path variable.
My situation is quite specific:
I was trying to install ffmpeg according to this tutorial https://www.geeksforgeeks.org/how-to-install-ffmpeg-on-windows/
The last step was setting the path variable setx /m PATH "C:\ffmpeg\bin;%PATH%"
It worked, however afterwards I noticed that if I try to call python from the command prompt or the powershell if run as administrator, I started getting 'chcp' is not recognized as an internal or external command, (although works fine if run as user), indicating that something is wrong with PATH variables.
I looked into my variables and saw this edit.
Path
It seems to me that the command added the ffmpeg line to the system path and possibly overwritten the original, which is why there are issues when using command prompt as administrator. It probably should have added it to the user Path (not system Path variable)
If that is the case, is there a way to restore the previous system Path variable. Maybe I can paste it from the user Path variable?
I already added the path to my system variables but still when I type swipl in the command prompt it doesn't open the program.
System Variables
When you add the path of SWIPL which is mostly found at "C:\Program Files\swipl\bin" (unless specified explicitly) to your System Variable - PATH. Then reopen you command prompt and try again.
I've installed Ruby and in the User Variables, I can see that Path = C:\Ruby22-x64\bin
However, when I run ruby in the cmd, it says 'ruby' is not recognized as an internal or external command, operable program or batch file.
I've accidentally deleted the Path in System Variables and I think that's why it's not working.
Could anyone guide me on how to restore or add the Path in the System Variable?
Thank you in advance!
The default value is:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
what it might worng in this code its not taking ipconfig command, does it is because of path settings in environment variable
The environment variable path contains a semicolon-separated list of directories which cmd scans to find an executable.
You should not change path without understanding the consequences. The file ipconfig.exe is usually stored in c:\Windows\System32 and possibly also c:\Windows\SysWOW64. At least one of these directories should be included in the list assigned to path in order to execute the command.
I have Windows 8.1 and I have a strange problem.
When I launch a Command Terminal, it seems that current directory and parent directory don't work when I try to use it to launch executable.
For example, considering the following folders :
C:/dirA/dirB/program.exe
C:/dirA/dirB/dirC
I put dirA/dirB in the PATH variable.
So, when I launch program.exe in Command Terminal, it works.
But, if I go in C:/ and launch the following command :
./dirA/dirB/program.exe
I got the following error :
'.' is not recognized as an internal or external command, operable
program or batch file.
Error is the same if I go on C:/dirA/dirB/dirC folder and launch the following command :
../program.exe
Error is :
'..' is not recognized as an internal or external command, operable
program or batch file.
So, I don't understand what is the problem and how to solve it. Someone have an idea and can help me ?
Thanks for your help.
Sylvain
If you want to use forward slashes (/) with paths in Windows Command Prompt you need to quote the whole path.
"./dirA/dirB/program.exe"
If you use backslashes (\) then you don't have to quote paths (unless your path contains spaces).