Home > front end >  I try to access my desktop thru my PowerShell, and its said "Cannot find path 'C:\Desktop
I try to access my desktop thru my PowerShell, and its said "Cannot find path 'C:\Desktop

Time:04-04

how can I fix this?

enter image description here

CodePudding user response:

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

CodePudding user response:

You have to go into your user directory and access it from there. Something like:

cd C:\Users\mfi\Desktop

mfi is the User in my case and you can access the desktop from there.

  • Related