相关文章推荐
讲道义的脸盆  ·  python ...·  1 年前    · 
满身肌肉的梨子  ·  Objective-C ...·  1 年前    · 
issue: When I enter bash.exe in a PowerShell cmd window, my PC does not launch the Ubuntu command. I think Windows Subsystem for Linux (WSL) is not in my $ENV:Path.

Troubleshooting I have done:

Reading on the Internet, I can test my $ENV:Path by typing the following a PowerShell cmd:

PS C:\WINDOWS\system32> where.exe calc

C:\Windows\System32\calc.exe

It returned the follow:

PS C:\WINDOWS\system32> (And the calculator displayed on my PC)

C:\WINDOWS\system32> $ENV:Path

C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Calibre2\;C:\Program Files\PuTTY\;C:\Program Files\Microsoft VS Code\bin;C:\Users\user-lenovo595\AppData\Local\Microsoft\WindowsApps

Question:

would you suggest as my next step to fix the issue?

Thank

tjcreek55

Harassment is any behavior intended to disturb or upset a person or group of people. Threats include any threat of violence, or harm to another. Any content of an adult theme or inappropriate to a community web site. Any image, link, or discussion of nudity. Any behavior that is insulting, rude, vulgar, desecrating, or showing disrespect. Any behavior that appears to violate End user license agreements, including providing product keys or links to pirated software. Unsolicited bulk mail or bulk advertising Any link to or advocacy of virus, spyware, malware, or phishing sites. Any other inappropriate content or behavior as defined by the Terms of Use or Code of Conduct. Hateful content that attacks, insults, or degrades someone because of a protected trait, such as their race, ethnicity, gender, gender identity, sexual orientation, religion, national origin, age, disability status, or caste. Any content about suicide and self-harm that could be dangerous. Any image, link, or discussion related to child pornography, child nudity, or other child abuse or exploitation. Hi and thanks for reaching out! I'm an Independent Advisor and a Microsoft user like you. Please allow me to assist with your issue.
Have you enabled "Windows Subsystem for Linux" optional feature?
With powershell running as an administrator, execute the following:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Check here for more information: https://docs.microsoft.com/en-us/windows/wsl/in...
Please let me know if I can help you further! Give back to the Community. Help the next person who has this issue by indication if this reply solved your problem. Click Yes or No below. Harassment is any behavior intended to disturb or upset a person or group of people. Threats include any threat of violence, or harm to another. Any content of an adult theme or inappropriate to a community web site. Any image, link, or discussion of nudity. Any behavior that is insulting, rude, vulgar, desecrating, or showing disrespect. Any behavior that appears to violate End user license agreements, including providing product keys or links to pirated software. Unsolicited bulk mail or bulk advertising Any link to or advocacy of virus, spyware, malware, or phishing sites. Any other inappropriate content or behavior as defined by the Terms of Use or Code of Conduct. Hateful content that attacks, insults, or degrades someone because of a protected trait, such as their race, ethnicity, gender, gender identity, sexual orientation, religion, national origin, age, disability status, or caste. Any content about suicide and self-harm that could be dangerous. Any image, link, or discussion related to child pornography, child nudity, or other child abuse or exploitation.

Thank you for the reply

Yes.  I enabled Windows Subsystem for Linux optional feature was enabled prior to me downloading, installing, and updating Ubuntu and Kali Linux on my PC.

After reading your reply, I wrote the following PowerShell script.

It does the following:

  • Displays current date and time
  • Gets the current status of Windows Subsystem for Linux
  • Displays current $ENV:Path
  • Displays current date and time
  • The script shows;

  • Windows Subsystem for Linux is Enabled
  • I don't see wsl in the $ENV:Path, shouldn't WSL be in the $ENV:Path?
  • Here are the PowerShell commands I used:

    Get-Date

    Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

    $ENV:PATH

    Get-Date

    I inserted the a pic of the output:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

    The script shows;

  • Windows Subsystem for Linux is Enabled
  • I don't see wsl in the $ENV:Path, shouldn't WSL be in the $ENV:Path?
  • Harassment is any behavior intended to disturb or upset a person or group of people. Threats include any threat of violence, or harm to another. Any content of an adult theme or inappropriate to a community web site. Any image, link, or discussion of nudity. Any behavior that is insulting, rude, vulgar, desecrating, or showing disrespect. Any behavior that appears to violate End user license agreements, including providing product keys or links to pirated software. Unsolicited bulk mail or bulk advertising Any link to or advocacy of virus, spyware, malware, or phishing sites. Any other inappropriate content or behavior as defined by the Terms of Use or Code of Conduct. Hateful content that attacks, insults, or degrades someone because of a protected trait, such as their race, ethnicity, gender, gender identity, sexual orientation, religion, national origin, age, disability status, or caste. Any content about suicide and self-harm that could be dangerous. Any image, link, or discussion related to child pornography, child nudity, or other child abuse or exploitation. Bash.exe is within C:\WINDOWS\system32 and is covered by your $ENV:Path. There isn't a WSL path on my installation too.
    What was the error or message you have encountered when trying to run bash.exe?
    If you were to navigate to C:\Windows\System32 and run .\bash.exe, does it work?
    Give back to the Community. Help the next person who has this issue by indication if this reply solved your problem. Click Yes or No below. Harassment is any behavior intended to disturb or upset a person or group of people. Threats include any threat of violence, or harm to another. Any content of an adult theme or inappropriate to a community web site. Any image, link, or discussion of nudity. Any behavior that is insulting, rude, vulgar, desecrating, or showing disrespect. Any behavior that appears to violate End user license agreements, including providing product keys or links to pirated software. Unsolicited bulk mail or bulk advertising Any link to or advocacy of virus, spyware, malware, or phishing sites. Any other inappropriate content or behavior as defined by the Terms of Use or Code of Conduct. Hateful content that attacks, insults, or degrades someone because of a protected trait, such as their race, ethnicity, gender, gender identity, sexual orientation, religion, national origin, age, disability status, or caste. Any content about suicide and self-harm that could be dangerous. Any image, link, or discussion related to child pornography, child nudity, or other child abuse or exploitation.