# \[PowerShell\] More Concise ShortPath

**URL:** <https://forum.kirupa.com/t/powershell-more-concise-shortpath/306749>\
**Category:** programming\
**Created:** [March 21, 2010, 8:48pm UTC](https://forum.kirupa.com/t/powershell-more-concise-shortpath/306749 "2010-03-21T20:48:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [March 21, 2010, 8:48pm UTC](https://forum.kirupa.com/t/powershell-more-concise-shortpath/306749/1 "2010-03-21T20:48:28Z")

</div>

Does anyone know of a more concise way to find the short path for a file in PowerShell script? I currently have this expression:

```auto
(New-Object -ComObject Scripting.FileSystemObject).GetFile("S:\Program Files\Adobe\Adobe Photoshop Lightroom 3 Beta\lightroom.exe").ShortPath

```

…to get `S:\PROGRA~1\Adobe\ADOBEP~1\LIGHTR~1.EXE`

However, it seems like an absurdly complicated expression given what I want to do. I don’t do much with PowerShell, though, so I thought that someone else might have a better way. Any ideas? :h:
