Windows 10 – Create File Folder shortcuts to network location

To create Shortcuts to network locations directly under This PC in Explorer follow the below steps.

To get the folders under This PC go to: “C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Network Shortcuts”

  1. Create the new folder (for example xyz)
  2. Put the following in desktop.ini in the new folder


  3. Create a shortcut named target.lnk in the folder pointing to the desired destination folder.
  4. Add the system attribute to the folder via an elevated command prompt

    C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Network Shortcuts>attrib +s “New folder”


This is also possible in Powershell Script form via the below function:

Just open an Elevated Powershell window.

Paste below Script and press enter

Now type: Add-NetworkLocation “FOLDERNAME” “FOLDERLOCATION” press enter

The folder is now created as a network folder under This PC.

function Add-NetworkLocation
    # Get the basepath for network locations
    $shellApplication = New-Object -ComObject Shell.Application
    $nethoodPath = $shellApplication.Namespace(0x13).Self.Path

    # Only create if the local path doesn't already exist & remote path exists
    if ((Test-Path $nethoodPath) -and !(Test-Path "$nethoodPath\$name") -and (Test-Path $targetPath))
        # Create the folder
        $newLinkFolder = New-Item -Name $name -Path $nethoodPath -type directory

        # Create the ini file
        $desktopIniContent = @"
        $desktopIniContent | Out-File -FilePath "$nethoodPath\$name\Desktop.ini"

        # Create the shortcut file
        $shortcut = (New-Object -ComObject WScript.Shell).Createshortcut("$nethoodPath\$name\target.lnk")
        $shortcut.TargetPath = $targetPath
        $shortcut.IconLocation = "%SystemRoot%\system32\SHELL32.DLL, 85"
        $shortcut.Description = $targetPath
        $shortcut.WorkingDirectory = $targetPath
        # Set attributes on the files & folders
        Set-ItemProperty "$nethoodPath\$name\Desktop.ini" -Name Attributes -Value ([IO.FileAttributes]::System -bxor [IO.FileAttributes]::Hidden)
        Set-ItemProperty "$nethoodPath\$name" -Name Attributes -Value ([IO.FileAttributes]::ReadOnly)