Navigate to folder directly before i can use command in in a command line - command

I don't know how to search for my problem here.
In the command line i must navigate everytime directly in the folder where the software was installed.
Before I can use the command "java -v" or "flutter doctor" or what ever i must navigate to the java or flutter folder and i don't know why.
Maybe someone of you knows the ONE solution.
I use windows 11. I think it might be due to the environment variables - the environment variables entered are automatically deleted all the time.

Related

'very_good' is not recognized as an internal or external command, operable program or batch file

I tried to activate very_good_cli in flutter with this command:
dart pub global activate very_good_cli
and result was this:
...
...
...
Building package executables...
Built very_good_cli:very_good.
Installed executable very_good.
Warning: Pub installs executables into ~\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
I also added ~\AppData\Local\Pub\Cache\bin to system Path, but this warning still persists and the error I get is:
'very_good' is not recognized as an internal or external command,
operable program or batch file
how can I solve this?
I just wanted to quickly put this together to make it obvious.
After running...
dart pub global activate very_good_cli
very_good.bat is added to your ~\AppData\Local\Pub\Cache\bin directory. So, you need your command-line shell to pick up on this change.
As mentioned above, if you run dart pub global activate very_good_cli a second time it will give you some good info in the form of a warning
Warning: Pub installs executables into `~\AppData\Local\Pub\Cache\bin`, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
So, if the warning states the ~\AppData\Local\Pub\Cache\bin is not in your path, you need to add it there. Something like this. This essentially allows your command-shell to recognize 'very_good' as a command.
Link to video showing the process of adding to path
Once you are done with that, you need your command-line shell(s) to pick up the change. Easiest way to do that is to close them completely and reopen them. A tricky situation you might run into is if you are using a shell inside of another process. I use powershell terminal in vscode. So, I had to close vscode to actually refresh the terminal.
Restarting your computer is the nuclear button that should get the issue resolved if your Environment Variables are setup correctly or if there isn't some other wonky issue with the shell you are using. Using the built in windows cmd is a good test to see if it is just a problem with your preferred shell.
So after running dart pub global activate very_good_cli and adding path to ...\Pub\Cache\bin to the Path in system environment variables, restarting the windows solved the issue.

Flutter install in windows environment variable

I have problem when trying to install the flutter in my desktop first I get error of :
is not recognized as an internal or external command operable program or batch file.
Then I open the system environment variable and add the flutter to the user variables path plus I add all of the flutter, git, system32 to systems variables path section.
Unfortunately, the problem is still present even with a restart.
Now when I type flutter doctor to Command prompt No results are shown and I cannot write an extra line.
Welcome to stackoverflow!
You should take these steps:
Open RUN by shortcut (WINDOWS_KEY+R_KEY)
Type in RUN SystemPropertiesAdvanced.
System Properties dialog should appear, click Environment Variables.
In User variables (The Top section) select Path and click Edit.
Add the new path to flutter Binary folder like this C:\flutter\bin.
Select OK, and OK again in Environment Variables, and OK in System Properties.
Close any Command prompt you using and reboot the system.
Hooray, :D now flutter is successfully installed.

'flutter' is not recognized in windows cmd prompt with elevated permissions

Flutter path is correct but still unable to be recognized by the windows command prompt. Looked everywhere asked anyone who used flutter still unable to figure out the problem.
Tried suggestions made on other questions similar to this still no luck and followed the tutorials on installing flutter did not work.
For Windows users (Windows 10)
Open Start menu and type env
Click on Environment Variables..
under User variables, select Path then click Edit
Click New then past this line C:\src\flutter\bin(supposing this is where 'bin' directory of Flutter is located on your machine)
Click 'OK'.
Restart is required to apply changes.
The command prompt you're using appears to be using elevated permissions and therefore will have the "system" environment variables but not your user ones necessarily. Try with a non-elevated command prompt... which you should be using anyways. Only use an elevated command prompt when absolutely needed as otherwise you could delete important things by accident. Also, you can run echo %PATH% to see what is actually in the path in the command prompt you're using.
If you want to use flutter across multiple users or need to use an elevated command prompt for some reason, add the path to flutter/bin to the system environment variables instead.
Adding the following things in the path solved the issue for me
C:\Program Files\Git\bin
C:\Program Files\Git\cmd
C:\Windows\System32
C:\Windows\SysWOW64\WindowsPowerShell\v1.0
C:\src\flutter\bin
For windows user make sure to include C:\Windows\System32 in your user PATH variable,this prevents the flutter command prompt from flashing when you click it.

PhoneGap command not recognized

I have followed the directions on PhoneGap's website and installed PhoneGap using the command prompt on Windows. However, after it has installed I try to run the command 'phonegap' and I get an error saying that 'phonegap' is not recognized as an internal or external command, operable program or batch file. How do I fix this? Thanks.
You might need to add phonegap to your classpath variable, in order to let the prompt know where the phonegap .exe file is located.
Try writing the full path of the exe file, if that runs, then what I mentioned above should solve your problem.
EDIT
Just looked at the install page at phonegap.com (http://phonegap.com/install/). Very scarce on the information I would say.. But I still recommend investigating the above.
The Problem with enthronement variable for default path of your your current user. Follow the steps.
Click the Start menu and type "regedit" on the search box. This will launch the Windows Registry Editor program.
Enter to the following Registry entry: HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
Select the "Enabled" entry in the right side window. If this entry is there, right-click and select "New" followed by "DWORD Value." Name the value "Enabled."
Right-click the "Enabled" entry and click "Modify."
Change the number in the "Value" box to "1." This will re-enable WSH.
close all opened cmd windows and open a new window.
Just try to run CMD as administrator. Hopefully that will solve your problem. This solved mine.
Even though this is a very old question, I'm going to post a solution that worked for me on Windows Vista/7/8. The problem is that by default the command prompt in which the npm command is run is not elevated. So launch a command prompt as administrator and then run npm command. If it is not elevated then the environment variables wont be set properly.
In windows 7 platform, when the latest version of phonegap (3.4) installed it hosts in path like this:
C:\Users\\AppData\Roaming\npm
Sometimes you should add this address to the PATH environment manually.
Go to System Properties-> Advanced -> Environment Variables
Select PATH variable from list and then edit it

Run, The Command Line and that Path Variable

I'm having a very weird issue with the command line and running Ant. I point the path variable at the location of my Ant bin directory (C:\Ant\bin) and when i go into a command window and type PATH it shows the location in it. But when I go to run Ant by typing "ant" it does nothing and states that it isn't recognized. But when I go to the run window (Windows+R) and type "ant" it runs it.
I have restarted Windows twice and the problem still persists. I am running Windows Vista Ultimate with SP1 installed. I have tried "Running as Administrator" with no difference.
Any one experience anything like this before?
Sometimes you can set a system-wide (or even just personal) Environment Variable and it'll cure it, as opposed to just setting it in your shell.
Go to the Control-panel, then System, then Advanced, and look for the button on Environment Variables. From there, you can follow your nose.
Good luck.
Ant also depends on Java to be on the path. Do you have that?
I would also check to make sure the environment variables ANT_HOME and JAVA_HOME are set up properly in the console.
Is there any chance that the command window you are trying to run Ant in is a different window to the cmd windwo where you set up and verify that its in the path? If the PATH is updated after a cmd window is already open it won't recongnise the change. Not clear if that might be your issue.
If you are in the dir C:\Ant\bin and type "ant" does it recognise it?