Reputation: 21
I just found that i cannot run most commands in windows cmd, such as "git", "java", "node".
I found a lots of answers telling me to set environment variables, the weird thing is, the environment variables looks good to me, and i can actually run these commands in powershell or git bash, but none of them works in windows cmd.
Hope anyone can give me some advise, thank q
Upvotes: 0
Views: 4832
Reputation: 54
As I understand,you are not able to run several commands in windows cmd.
Windows PowerShell is the new Microsoft shell that combines the old cmd functionality with a new scripting/cmdlet instruction set with built-in system administration functionality, so there would be several commands which would work in PowerShell but not in Command Prompt.
Use setx.exe to set persistent environment variables via Command Prompt using following command -
setx [variable_name] "[variable_value]"
Please note, setx.exe does not set the environment variable in the current command prompt, but it will be available in subsequent command prompts.
Upvotes: 1