8

How can I create a shortcut in the "This PC" section in File Explorer of Windows 10?

Like a shortcut of a mapped network location or a folder of mounted drive.

God of Money
  • 135
  • 1
  • 1
  • 8

5 Answers5

13

You can make a folder appear as a separate drive in "This PC" by using the subst command. For example:

subst z: C:\Users\yourUsername\Documents\Whatever\Folder\Path

Add a shortcut to run this command to your startup folder to make it apply at each login.

kicken
  • 1,923
10

You cannot add shortcuts under "This PC", you may only add folders.

It would be much easier to add a folder under "Quick access" by right-click on the folder and select "Pin to Quick access".

If you really want to pin folders to "This PC", use this workaround:

  • The folder must first be defined as a network share by right-click, select Properties and go to the Sharing tab.

  • Once the folder is defined as a network share, right-click "This PC", select "Add a network location", Next twice, then enter \\127.0.0.1 and click Browse. Find your share and add it.

harrymc
  • 498,455
3

To expand on harrymc's answer, using Add a network location is definitely the easiest way to add shortcuts to folders under This PC; but the functionality is not limited to network shares. For starters, you can add a local folder by specifying the path in UNC format:

  • \\<ComputerName>\Path\to\Folder

    enter image description here

The folder/shortcut is then added to the Network Locations section of This PC and double-clicking opens the folder, with the Address bar displaying the namespace path:

  • This PC > TargetFolder

    enter image description here

The one drawback at this point is that, if you use the Copy as path function for any file or folder, the UNC path is copied to the clipboard, which may be undesirable:

  • "\\JP\Users\keith\Music\ABBA\Hits, Vol. 2"

But this can be remidied -- once you know where to look and what to do.

When you add a network locaiton using the wizard, the shortcuts are created in the user's Network Locations folder which has the path:

  • %AppData%\Microsoft\Windows\Network Shortcuts

It's most easily viewed in Explorer by clicking in the Address bar and typing:

  • shell:NetHood

It's informative to switch to a Details view and add the Attributes column. You'll see your network locations display a Type of File Folder but with the shortcut arrow overlay (which is not present when viewed under This PC):

enter image description here

If you view a shortcut's Properties dialog, you'll see it only has two tabs. And, unlike a .lnk shortcut to a folder, when you double-click on the shortcut, the target folder is displayed as a sub-folder of the Network Shortcuts folder. With a .lnk shortcut, the location from which it's launched is irrelevant -- Explorer "jumps" to the target folder.

These are Folder shortcuts, a clever trick of the Windows shell. If you open PowerShell or Command prompt to the Network Shortcuts directory, then cd into a shortcut-named directory, and then list all files, you'll see only two:

S C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network Shortcuts> sl ABBA
PS C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network Shortcuts\ABBA> gci -Force
Directory: C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network
Shortcuts\ABBA


Mode LastWriteTime Length Name


---hs- 4/29/2023 8:55 AM 75 desktop.ini -a---- 4/29/2023 8:55 AM 1608 target.lnk

PS C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network Shortcuts\ABBA>

If you added the Attributes column in Network Shortcuts, you'll note that all the shortcuts have their ReadOnly attribute set -- and that's what tells Explorer to process the desktop.ini file. So clearing that attribute gives you a chance to examine the files more closely via the GUI:

PS C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network Shortcuts\ABBA> (gi .).Attributes -= 'ReadOnly'
PS C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network Shortcuts\ABBA>

Now Explorer displays the actual contents of the folder, which allows you to view the contents of the desktop.ini file and the properties of Target.lnk:

enter image description here

From Target.lnk's Properties dialog, you can change a local UNC path to a <Drive>:\<Path> format (edit the Comment field as well). After editing, you can re-set the ReadONly attribute:

PS C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network Shortcuts\ABBA> (gi .).Attributes += 'ReadOnly'
PS C:\Users\keith\AppData\Roaming\Microsoft\Windows\Network Shortcuts\ABBA>

which restores the Folder shortcut to its default behavior. And with Target.lnk's path modified, Copy as path now returns a "normal" path:

  • "C:\Users\keith\Music\ABBA\Hits, Vol. 2"

And once you understand the format, you can create Folder shortcuts manually or via script. Also, they can be created/placed in any file-system location. The critical elements are:

  1. A desktop.ini file with these entries:

    [.ShellClassInfo]
    CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
    Flags=2
    
  2. A .lnk shortcut to the target folder, which must:

    • Be named Target.lnk
    • Target a file-system location (at least I've had no luck with virtual locaitons)
  3. The folder containing these two files must have its ReadOnly attribute set for Explorer to process the desktop.ini info.

Keith Miller
  • 10,694
  • 1
  • 20
  • 35
1

Create a desktop shortcut:

  • Right-click on Desktop.
  • Select New > Shortcut.
  • For the location, enter `explorer [location]>*. For example:
    • To open D: drive, enter explorer D:.
    • To open a remote shared resource, use UNC path. To access shared folder JupPlan on machine HAL, enter \\HAL\JupPlan. N.B. MS Windows requires backslashes, but translates them for network access to other OS.
0

There is a tool by Winaero which does exactly what you are trying to do:

This PC Tweaker

With This PC Tweaker, you will be able to perform the following customizations:
  • to add any folder to the Computer/This PC folder. Really any.
  • to remove any folder from the Computer/This PC folder.
  • to change the icon for any folder inside Computer/This PC.
  • to add any shell location like Administrative tools, God Mode, Network Connections
  • you can pin or unpin Computer/This PC items from the Navigation Pane of Explorer in Windows 8.1, Windows 8 and even in Windows 7!
  • You can remove or add any item from the Folders category inside the Computer/This PC folder.
  • to restore defaults with one click.

w123
  • 101
  • 1