Saturday, July 11, 2020

Windows How to Create/Copy a File Shortcut using File Explorer

As with many of blog posts on this site, I create a rudimentary, background post for a more complex development or devops issue to be addressed in a future post. Today's topic is just such a rudimentary blog post and presents a basic Windows concept, namely how to create a shortcut. 

The file to which the shortcut will link will be c:\bin\nuget.exe which shows File Explorer as having a size of 6,424 KB:

Shortcuts are not limited to executable files like nuget.exe. A shortcut or link can be created to any file type in Windows or shortcuts can point to folders.

To create a shortcut, using File Explorer, navigate to the folder in which the shortcut is to be created. Right click on the folder and select New | Shortcut from the context menu displayed by the right click action:

When New | Shortcut is selected, the Create Shortcut wizard will be displayed as follows:

Click on the Browse button to select the source file via the Browse for Files or folders dialog:

The title of the dialog, Browse for Files or Folders, is a clear indication that shortcuts can reference files or folders. Using the dialog, navigate to the file to which the shortcut will reference;

Click on OK which closes the Browse for Files and Folder dialog:

Click on Next which allows the shortcut to be named:

Click on Finish which shows the folder (C:\SomeFolder) containing the newly created shortcut:

Recall that the actually file, c:\bin\nuget.exe, is 6,424 KB. The shortcut is 1 KB (actually less) and demarcated by an icon indicating it is a link. Under the covers, a shortcut is just a file referencing a file stored in a different location.

It is possible to copy a shortcut to a different folder either using File Explorer's context menu or using CTRL+C, CTRL+V. Below is an example of the shortcut, C:\SomeFolder\nuget.exe, copied to a different location:

The shortcut versus the file referenced by the shortcut can even be copied to Google Drive:

Notice the file size is 866 bytes indicating the shortcut was copied and not the 6,624 KIB original file. Obviously, the shortcut stored on Google Drive's cloud storage can't invoke c:\bin\nuget.exe.

One reason to copy the shortcut cloud storage is that the shortcut could be download and used on a different computer. As long as the destination file (c:\bin\nuget.exe) resides on the same location on a different Windows machine, the shortcut can be downloaded and used on a different Windows machine.

No comments :

Post a Comment