Windows 10: How to batch-resolve file shortcuts turn shortcuts into the files they link to ?

Discus and support How to batch-resolve file shortcuts turn shortcuts into the files they link to ? in Windows 10 Network and Sharing to solve the problem; Hi! I'm considering to use file shortcuts lnk files for my documents in order to allow a single file to occur in multiple folders - as a real file in... Discussion in 'Windows 10 Network and Sharing' started by RalfHF, Feb 21, 2021.

  1. RalfHF Win User

    How to batch-resolve file shortcuts turn shortcuts into the files they link to ?


    Hi!


    I'm considering to use file shortcuts lnk files for my documents in order to allow a single file to occur in multiple folders - as a real file in one folder and as file shortcuts in other folders.


    However, I will have to export folders with many of these file shortcuts to external parties.

    This is when I want the shortcuts to be replaced by the files they link to.


    Isn't there a Windows feature that allows me to do that?

    I haven't found one.


    Kind regards

    Ralf

    :)
     
    RalfHF, Feb 21, 2021
    #1
  2. Flava0ne Win User

    Creating Shortcuts with Batch File

    Tried both of the VB Scripts that you provided and adding the 9 switch to the batch file but neither was able to create a shortcut to my desktop.
     
    Flava0ne, Feb 21, 2021
    #2
  3. Flava0ne Win User
    Creating Shortcuts with Batch File

    I've created a Batch file which calls on the following VB Script to be able to create a shortcut to my desktop:

    VB Script (named createLink.vbs):
    Code: set objWSHShell = CreateObject("WScript.Shell") set objFso = CreateObject("Scripting.FileSystemObject") ' command line arguments ' TODO: error checking sShortcut = objWSHShell.ExpandEnvironmentStrings(WScript.Arguments.Item(0)) sTargetPath = objWSHShell.ExpandEnvironmentStrings(WScript.Arguments.Item(1)) sWorkingDirectory = objFso.GetAbsolutePathName(sShortcut) set objSC = objWSHShell.CreateShortcut(sShortcut) objSC.TargetPath = sTargetPath objSC.WorkingDirectory = sWorkingDirectory objSC.Save[/quote] Batch File Example (for Windows Notepad):
    Code: @Echo off cscript createLink.vbs "C:\Users\Administrator\Desktop\Notepad.lnk" "C:\Windows\System32\notepad.exe"[/quote] But after creating the shortcut using this method, I'm not able to assign a custom icon for the shortcut. I get the following error message when trying to do so:


    How to batch-resolve file shortcuts turn shortcuts into the files they link to ? Error503.jpg


    Any help and ideas on what I need to put into the VB Script and/or Batch File to be able to do this would be greatly appreciated! *Big Grin How to batch-resolve file shortcuts turn shortcuts into the files they link to ? :D

    Also, I know that I can simply do this by going to Start Menu\All Programs\Accessories\ right-clicking on Notepad and selecting Send to\Desktop (create shortcut). Easy enough for creating a single shortcut. But I need to create several multiple shortcuts and using this Batch/VBS method would really save me a lot of time in doing so.
     
    Flava0ne, Feb 21, 2021
    #3
  4. How to batch-resolve file shortcuts turn shortcuts into the files they link to ?

    Creating Shortcuts with Batch File

    Hmm, I just tried it and it worked fine. Maybe try running the batch as administrator? Also, right click on the desktop after the shortcut is created and click Refresh.

    If the file in the third parameter doesn't exist, it assumes the icon is in the application.
     
    FordGT90Concept, Feb 21, 2021
    #4
Thema:

How to batch-resolve file shortcuts turn shortcuts into the files they link to ?

Loading...
  1. How to batch-resolve file shortcuts turn shortcuts into the files they link to ? - Similar Threads - batch resolve file

  2. How to run a Windows Apps shortcut in a batch file?

    in Windows 10 Network and Sharing
    How to run a Windows Apps shortcut in a batch file?: Hi,I'm trying to open a couple of programs OBS and the Minecraft Launcher in a batch file that I will then make a shortcut for so I can launch them with one press of a key on my Num Pad. I was wondering how I could open the Minecraft Launcher in this batch file? The issue...
  3. How to run a Windows Apps shortcut in a batch file?

    in Windows 10 Gaming
    How to run a Windows Apps shortcut in a batch file?: Hi,I'm trying to open a couple of programs OBS and the Minecraft Launcher in a batch file that I will then make a shortcut for so I can launch them with one press of a key on my Num Pad. I was wondering how I could open the Minecraft Launcher in this batch file? The issue...
  4. How to run a Windows Apps shortcut in a batch file?

    in Windows 10 Software and Apps
    How to run a Windows Apps shortcut in a batch file?: Hi,I'm trying to open a couple of programs OBS and the Minecraft Launcher in a batch file that I will then make a shortcut for so I can launch them with one press of a key on my Num Pad. I was wondering how I could open the Minecraft Launcher in this batch file? The issue...
  5. update shortcut / link file

    in Windows 10 Gaming
    update shortcut / link file: I been trying to update one of the icons/links on my desktop ---- I am trying to add switches to the target command in the link file but it does not seem to be working --- I am not sure what I am missing here --- I am in elevated mode but after I add the text and "apply" it...
  6. update shortcut / link file

    in Windows 10 Software and Apps
    update shortcut / link file: I been trying to update one of the icons/links on my desktop ---- I am trying to add switches to the target command in the link file but it does not seem to be working --- I am not sure what I am missing here --- I am in elevated mode but after I add the text and "apply" it...
  7. update shortcut / link file

    in Windows 10 Customization
    update shortcut / link file: I been trying to update one of the icons/links on my desktop ---- I am trying to add switches to the target command in the link file but it does not seem to be working --- I am not sure what I am missing here --- I am in elevated mode but after I add the text and "apply" it...
  8. Shortcut or batch file for particular Services.msc actions?

    in Windows 10 Software and Apps
    Shortcut or batch file for particular Services.msc actions?: I'm a long-time Windows user who likes assigning keyboard hotkeys to shortcuts for lots of things. However, I find that the hotkeys often don't work. It's all or none; they all work, or none of them.Some googling and experimentation show that the issue is with the Human...
  9. how to add powershell batch file shortcut to taskbar

    in Windows 10 Support
    how to add powershell batch file shortcut to taskbar: Hi I have several batch files which I've created shortcuts for, and added to my windows taskbar. I now have a new batch file which contains some powershell which instructs pc to switch off screen. Please can anyone advise why Windows won't let me place this shortcut on the...
  10. how to add powershell batch file shortcut to taskbar

    in Windows 10 Performance & Maintenance
    how to add powershell batch file shortcut to taskbar: Hi I have several batch files which I've created shortcuts for, and added to my windows taskbar. I now have a new batch file which contains some powershell which instructs pc to switch off screen. Please can anyone advise why Windows won't let me place this shortcut on the...