Windows 10: Adding batch file shortcut to Startup menu?

Discus and support Adding batch file shortcut to Startup menu? in Windows 10 Customization to solve the problem; For diagnosing purposes I need to add a batch file to Windows Startup menu and it must be run with the administrator privileges. For that I created a... Discussion in 'Windows 10 Customization' started by jastrzab, May 31, 2023.

  1. jastrzab Win User

    Adding batch file shortcut to Startup menu?


    For diagnosing purposes I need to add a batch file to Windows Startup menu and it must be run with the administrator privileges. For that I created a shortcut to it.There is not any problem when I execute it by hand, however Windows Startup ignores that entry.Please advise,/jas

    :)
     
    jastrzab, May 31, 2023
    #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, May 31, 2023
    #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:


    Adding batch file shortcut to Startup menu? [​IMG]


    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 Adding batch file shortcut to Startup menu? :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, May 31, 2023
    #3
  4. Adding batch file shortcut to Startup menu?

    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, May 31, 2023
    #4
Thema:

Adding batch file shortcut to Startup menu?

Loading...
  1. Adding batch file shortcut to Startup menu? - Similar Threads - Adding batch file

  2. Send To Menu - Adding App's Shortcut

    in Windows 10 Network and Sharing
    Send To Menu - Adding App's Shortcut: I managed to put WhatsApp shortcut in "Send To Menu"; to help in sending attachments directly from their folders. When I open the menu folder, I find the shortcut there, but when I try to R-Click > Send To a file, the short cut is not there in the menu. How can I fix this?...
  3. Send To Menu - Adding App's Shortcut

    in Windows 10 Gaming
    Send To Menu - Adding App's Shortcut: I managed to put WhatsApp shortcut in "Send To Menu"; to help in sending attachments directly from their folders. When I open the menu folder, I find the shortcut there, but when I try to R-Click > Send To a file, the short cut is not there in the menu. How can I fix this?...
  4. Send To Menu - Adding App's Shortcut

    in Windows 10 Software and Apps
    Send To Menu - Adding App's Shortcut: I managed to put WhatsApp shortcut in "Send To Menu"; to help in sending attachments directly from their folders. When I open the menu folder, I find the shortcut there, but when I try to R-Click > Send To a file, the short cut is not there in the menu. How can I fix this?...
  5. Adding batch file shortcut to Startup menu?

    in Windows 10 Gaming
    Adding batch file shortcut to Startup menu?: For diagnosing purposes I need to add a batch file to Windows Startup menu and it must be run with the administrator privileges. For that I created a shortcut to it.There is not any problem when I execute it by hand, however Windows Startup ignores that entry.Please...
  6. Adding batch file shortcut to Startup menu?

    in Windows 10 Software and Apps
    Adding batch file shortcut to Startup menu?: For diagnosing purposes I need to add a batch file to Windows Startup menu and it must be run with the administrator privileges. For that I created a shortcut to it.There is not any problem when I execute it by hand, however Windows Startup ignores that entry.Please...
  7. How to batch-resolve file shortcuts turn shortcuts into the files they link to ?

    in Windows 10 Network and Sharing
    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...
  8. Adding shortcut icon to the start menu

    in Windows 10 Customization
    Adding shortcut icon to the start menu: I have created a powershell script for a custom shutdown. Is it possible to add the shortcut icon to the start menu. See image. [img] 159199
  9. Trying to drag a shortcut to a batch file onto my start menu

    in Windows 10 Support
    Trying to drag a shortcut to a batch file onto my start menu: I wanted to drag a shortcut to a batch file onto the tiled area of my start menu but I'm just getting a no-go/banned symbol. How do I overcome this? Thanks. [img] 115452
  10. Startup batch file

    in Windows 10 Support
    Startup batch file: When Windows 10 starts, a DOS window appears, runs: C:\Users\Brian\AppData\Local\854e8f7.bat , then disappears. The .bat file contains: start "plqcknRlU67iM4TfEXQq" "%LOCALAPPDATA%\b183312\88d4f24.21b2bbd3" There are two files in C:\Users\Brian\AppData\Local\...