Question

So when I open the command prompt with RUN (Windows key + R, type cmd) I get this path (which is the good one) :

PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
s (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA
 Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbe
m;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Liv
e\Shared;C:\Ruby193\bin

The problem is that when I directly open C:\Windows\System32\cmd.exe or hold shift and right click in a folder and "Open command window here" I get this path (which is old and outdated):

PATH=C:\Ruby200\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Fil
es (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windo
ws\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x
86)\Windows Live\Shared;C:\Ruby200\devkit\bin;C:\Ruby200\devkit\mingw\bin

Both prompt are opened as Administrator, they both show the same title (Administrator: C:\Windows\System32\cmd.exe).

Anyone have an idea on how to fix that ?

Thanks

Was it helpful?

Solution

Checking the path :

reg query "HKCU\Environment" /v Path
reg query "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" /v Path

The GUI way :

  • Win+Pause keys
  • Advanced system settings
  • Environment Variables button
  • Check Path value in System variables.

Checking any starting script for CMD :

reg query "HKCU\Software\Microsoft\Command Processor" /v AutoRun
reg query "HKLM\Software\Microsoft\Command Processor" /v AutoRun

Searching anywhere in the Registry :

reg query "HKCU" /s|find /i "C:\Ruby200"
reg query "HKLM" /s|find /i "C:\Ruby200"

Obvious advice : restart your computer if you just uninstalled Ruby 2.0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top