I've been setup my variables for my development environment using the Windows cmd, but it works well only the first time I set them with the System>Advanced>Env Vars dialog. I just restart cmd and it works.
But after I restart the computer, it behaves quite weird. Like I have to restart cmd an indeterminate number of times for it to get the variables I set. Sometimes it even shows in the cmd when I issue the command SET, but it doesn't work if I issue a command from one of those paths. This is how it looks:
C:\Users\Adrian>set
ALLUSERSPROFILE=C:\ProgramData
ANDROID_HOME=F:\Programas\android-sdk
ANDROID_SDK_HOME=F:\Programas\android-sdk
ANT_HOME=F:\Programas\ant
APPDATA=C:\Users\Adrian\AppData\Roaming
BIN_DIR=F:\Programas\bin
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=SAKURA
ComSpec=C:\WINDOWS\system32\cmd.exe
configsetroot=C:\WINDOWS\ConfigSetRoot
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Adrian
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_60
JAVA_SDK_HOME=C:\Program Files\Java\jdk1.7.0_60
LOCALAPPDATA=C:\Users\Adrian\AppData\Local
LOGONSERVER=\\SAKURA
MAVEN_HOME=F:\Programas\maven\
MOZ_PLUGIN_PATH=C:\PROGRAM FILES (X86)\FOXIT SOFTWARE\FOXIT READER\plugins\
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x8
6)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:
\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:
\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\
Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Int
el(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Man
agement Engine Components\IPT;C:\Program Files\Lenovo\Bluetooth Software\;C:\Pro
gram Files\Lenovo\Bluetooth Software\syswow64;C:\Program Files\nodejs\;%ANDROID_
HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin;F:\Programas\ant\bin;C
:\Program Files (x86)\Git\cmd;C:\Program Files\Microsoft SQL Server\110\Tools\Bi
nn\;C:\Program Files (x86)\sbt\bin;F:\Programas\bin;%MAVEN_HOME%\bin;C:\Users\Ad
rian\AppData\Roaming\npm
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3c03
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SBT_HOME=C:\Program Files (x86)\sbt\
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\Adrian\AppData\Local\Temp
TMP=C:\Users\Adrian\AppData\Local\Temp
USERDOMAIN=SAKURA
USERDOMAIN_ROAMINGPROFILE=SAKURA
USERNAME=Adrian
USERPROFILE=C:\Users\Adrian
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools
\
windir=C:\WINDOWS
C:\Users\Adrian>adb
"adb" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
C:\Users\Adrian>adb
"adb" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
C:\Users\Adrian>javac
"javac" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
C:\Users\Adrian>
There is a var called ANDROID_SDK_HOME that was replaced by ANDROID_HOME. That first one doesn't even exist in the registry!
Registry for user vars:
Registry for system vars:
What could be wrong?
PD: This is on Windows 8.1 Update 1
Answer
It seems its a known issue on multiple versions of Windows.
I've never encountered this problem before, but following what is written here: https://superuser.com/a/484101/245733 and following the VbNetMatrix comment here: https://nuxx.net/blog/2011/08/15/shell-variables-not-expanding-in-path-on-windows-7-non-administrator-command-prompt/ I've been able to workaround it.
Variables were created as REG_SZ instead of REG_EXPAND_SZ. After changing the types in regedit and triggered to update the PATH variable expansion by clicking on "Modify" for the PATH variable in the environment variable configuration dialog (System>Advanced>Env. Vars, I don't know the exact names, my OS is set to Spanish language) the cmd was able to access those commands that were on the paths referenced in the variables I set before.
Comments
Post a Comment