Get shortpath using powershell

Question:

I am trying to get shortpath using the below code in powershell. For some folders it works. For some it does not work.

I get the below error although the folders are available :

Can someone please help

Answer:

Distinguish files and folders:


Output:

Source:

Get shortpath using powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply