Search code examples
powershellterminalpathcomdesktop

I try to access my desktop thru my PowerShell, and its said "Cannot find path 'C:\Desktop' because it does not exist"


how can I fix this?

enter image description here


Solution

  • Desktop is a special folder and to get the path to it, you can use

    Set-Location ([environment]::GetFolderPath('Desktop'))
    

    cd is an alias to the Set-Location cmdlet