I've recently tried changing my environment variables to set paths to javac.exe (among other things). It was working fine until, all of a sudden, I started getting this error. For example, I declared a JAVA_HOME variable to be
C:\Program Files\Java\jdk1.7.0_25
After which, I add
%JAVA_HOME%\bin
to the PATH variable, but this gives me an error:
'C:\Program' is not recognized as an internal or external command, operable command or batch file.
This error makes it seem like it's running into problems with the space in "Program Files". This is weird, though, since it wasn't doing this for a good while, then started. Further, there are other variables with spaces in them that work just fine. I've tried deleting the variable and recreating it, putting quotes around JAVA_HOME (which goes to the correct path, but does not find javac.exe correctly)..
Any tips on what I might do?
This is on Windows 7.
EDIT:
The environment variables were set by going Control Panel > Advanced System Settings > Environment Variables. The value of the variables were set by copying the address of the folder I want through an Explorer window. I added it to the PATH environment variable by appending the address with a space between the preceding variable and a semicolon at the end, as such:
C:\Users\Demo_User_1\AppData\Roaming\npm; %JAVA_HOME%
where the JAVA_HOME variable is defined as such:
C:\Program Files\Java\jdk1.7.0_25
I test the value of the variable through a command prompt by typing %JAVA_HOME%, and that's where I get the resulting error of "'C:\Program' is not recognized..."
The results of 'set' are as follows:
C:\Users\Demo_User_1>set ALLUSERSPROFILE=C:\ProgramData ANDROID_HOME=C:\Users\Demo_User_1\Desktop\Android\adt-bundle-windows-x86_64-2013 0717\sdk APPDATA=C:\Users\Demo_User_1\AppData\Roaming CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=DEMO_USER_1-HP ComSpec=C:\Windows\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: HOMEPATH=\Users\Demo_User_1 JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25 LOCALAPPDATA=C:\Users\Demo_User_1\AppData\Local LOGONSERVER=\\DEMO_USER_1-HP NUMBER_OF_PROCESSORS=4 OnlineServices=Online Services OS=Windows_NT Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Clien t\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows; C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\ x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\I ntel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Managem ent Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engin e Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Compone nts\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\Wir elessCommon\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\ Tools\Binn\;C:\Program Files\nodejs\; C:\Users\Demo_User_1\Desktop\Android\adt-b undle-windows-x86_64-20130717\sdk/platform-tools; C:\Users\Demo_User_1\Desktop\A ndroid\adt-bundle-windows-x86_64-20130717\sdk\tools; %JAVA_HOME%; %ANT_HOME%/bin ; C:\Program Files\Java\jdk1.7.0_25\bin; C:\Users\Demo_User_1\AppData\Roaming\np m; "%JAVA_HOME%"; ;C:\Users\Demo_User_1\Desktop\Android\adt-bundle-windows-x86_6 4-20130717\sdk/tools; C:\Users\Demo_User_1\Desktop\Android\adt-bundle-windows-x8 6_64-20130717\sdk/platform-tools PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PCBRAND=Pavilion Platform=MCD PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=3a09 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 SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\DEMO_U~1\AppData\Local\Temp TMP=C:\Users\DEMO_U~1\AppData\Local\Temp USERDOMAIN=Demo_User_1-HP USERNAME=Demo_User_1 USERPROFILE=C:\Users\Demo_User_1 VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools \ windir=C:\Windows windows_tracing_flags=3 windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
You can resolve this issue in three ways: First, use the full path of the executable file to launch the program. Second, add the program path to Windows environment variables. Finally, move the files to the System32 folder.
A batch file is a script file that stores commands to be executed in a serial order. It helps automate routine tasks without requiring user input or intervention. Some common applications of batch files include loading programs, running multiple processes or performing repetitive actions in a sequence in the system.
While in the command prompt type "cd\", then enter. From there type "cd\program" then hit the tab button until you see "c:\program files (x86)", then hit enter.
`C:\Program : The term 'C:\Program' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
In the vast majority of cases, adding, or re-adding C:WindowsSystem32 to the path will fix the ‘PROGRAM is not recognized as an internal or external command, operable program or batch file’ error. Otherwise, removing the %SystemRoot% entry should do the trick.
This seems to happen from time to time with programs that are very sensitive to command lines, but one option is to just use the DOS path instead of the Windows path. This means that C:\Program Files\ would resolve to C:\PROGRA~1\ and generally avoid any issues with spacing.
Originally Answered: How fix this error Apktool' is not recognized as an internal or external command, operable program or batch file? Try executing the command from within its folder. Open Command Prompt/PowerShell then type cd “path o\apktool\folder” (including the “ marks) where path o\apktool\folder is the full path of where apktool is located.
Yet another solution is to do this: C:\Program Files
has a short name
C:\Progra~1
in windows.
so simply write Progra~1 instead of the Program Files. {added missing 'r'}
Okay, that makes it clearer.
There are two main problems here.
First of all, the reason you're getting 'C:\Program' is not recognized...
is, of course, because it contains spaces. The fact that you have it quoted in the PATH environment variable has no relation to how %JAVA_HOME% is interpreted at the prompt. You have two options.
"C:\Program Files\Java\jdk1.7.0_25"
"%JAVA_HOME%\bin"
at the prompt. Of course, you'll get the "not recognized as an internal or external command, operable program or batch file" error unless you end the path with an executable (e.g. "%JAVA_HOME%\bin\javac.exe"
), but you'll see that this way it complains about '"C:\Program Files\Java\jdk1.7.0_25"' rather than 'C:\Program'.Second, you can't use environment variables in the path. You can use environment variables when you set the path at the command prompt. For example,
set PATH=%PATH%;%JAVA_HOME%
will work, but that's because %JAVA_HOME% is expanded at the command line and PATH is set to the result. If you check the value of PATH, you'll see that it ends with C:\Program Files\Java\jdk1.7.0_25, not %JAVA_HOME%.
Also, if javac.exe is in the bin subdirectory, you'll need to include that in the path, i.e. add ;C:\Program Files\Java\jdk1.7.0_25\bin
to the path.
(BTW, you have %JAVA_HOME% in the path twice, and there's an extra semicolon after the second one.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With