Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Great code! Out of curiosity, since this works for the directory the script is currently in, do you have a way to get it to show up in every directory? Otherwise, it doesn't seem like there's much difference between learning this and learning to make a shortcut the native way. You would still have to drag and drop the script into the current folder, wouldn't you?</p> <p>While stumbling toward a solution, I got as far as letting users navigate to and select a particular file they need to link to. I don't know if you would have any use for that. </p> <pre><code>Dim diaSelectFile Set diaSelectFile = Application.FileDialog(msoFileDialogFilePicker) diaSelectFile.Show strPickedFile = diaSelectFile.SelectedItems(1) Set diaSelectFile = Nothing Dim oWsh Dim myshortcut Dim oShortcut Dim strSplitFileName Dim strTarget Dim nShortName Set oWsh = CreateObject("WScript.Shell") strSplitFileName = Split(strPickedFile, "\") nShortName = UBound(strSplitFileName) strTarget = strSplitFileName(nShortName) myshortcut = "C:\users\%USERNAME%\Desktop\" &amp; strTarget &amp; " - Shortcut" &amp; ".lnk" Set oShortcut = oWsh.CreateShortcut(myshortcut) With oShortcut .TargetPath = strPickedFile .Save End With Set oWsh = Nothing Set oShortcut = Nothing </code></pre> <p>Again, though, this feels more complex than right-clicking and sending a shortcut to the desktop. Who are the users that need this? I know I've had austistic friends who struggle with what we might consider basic tasks on the computer. I'd definitely be interested to know if the script you came up with actually helps your clientele.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload