Shortcut created for a folder using powershell is of file target type instead of file folder RRS feed

  • Question

  • I used the following command lines to create a shortcut using powershell for network share.

    $WshShell = New-Object -comObject WScript.Shell
    $Shortcut = $WshShell.CreateShortcut("C:\Users\Public\Desktop\shortcut.lnk)
    $Shortcut.TargetPath = "\\network share"
    The shortcut created has target type as file instead of file folder.The shortcut created manually is of type file folder.Can someone help to create a  shortcut for the folder with target type as file folder using powershell or any other scripts?

    Thanks in advance
    Tuesday, August 18, 2020 5:40 PM