Windows 10: Creating Keyboard Shortcut via Batch

Discus and support Creating Keyboard Shortcut via Batch in Windows 10 Ask Insider to solve the problem; I want to create my own tool for Windows 10. The plan is to run it by pressing (For example) the "F4" key. I am aware, that I can just configure it to... Discussion in 'Windows 10 Ask Insider' started by /u/SensitiveDish8, Jul 17, 2020.

  1. Creating Keyboard Shortcut via Batch


    I want to create my own tool for Windows 10. The plan is to run it by pressing (For example) the "F4" key.

    I am aware, that I can just configure it to run over the gui, but for easier setup I would greatly appreciate it to set up the shortcut via a command.

    Does anybody know if this works, and, in case it does, tell me how to do so?

    Thank you very much!

    submitted by /u/SensitiveDish8
    [link] [comments]

    :)
     
    /u/SensitiveDish8, Jul 17, 2020
    #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, Jul 17, 2020
    #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:


    Creating Keyboard Shortcut via Batch 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 Creating Keyboard Shortcut via Batch :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, Jul 17, 2020
    #3
  4. Creating Keyboard Shortcut via Batch

    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, Jul 17, 2020
    #4
Thema:

Creating Keyboard Shortcut via Batch

Loading...
  1. Creating Keyboard Shortcut via Batch - Similar Threads - Creating Keyboard Shortcut

  2. Created accidental keyboard shortcut, can't change

    in Windows 10 Customization
    Created accidental keyboard shortcut, can't change: I use the numpad on my fullsize keyboard frequently, and for some reason now when I push the numpad 9, it opens a Windows volume mixer on on the side of my screen. In order to use the numpad 9 to type the number as intended, I have to hold the Windows key while I press it....
  3. How to programmatically create a desktop shortcut link via Powershell or batch file command...

    in Microsoft Windows 10 Store
    How to programmatically create a desktop shortcut link via Powershell or batch file command...: Currently the *.appxbundle installs into the StartMenu, which is fine, but I'd also like to include a shortcut link on the destkop. I see from this link that it's possible to create a short-cut manually for a sideloaded or Windows Store application....
  4. Create batch files with Batch?

    in Windows 10 Software and Apps
    Create batch files with Batch?: How to create Batch and VBS files with Batch? So I write a batch file which I then convert to exe that creates new folders in a certain directory and then creates batch and VBS files with a certain content and saves them in the created folder. So it's similar to a program...
  5. Is there a way to create a keyboard shortcut to paste text?

    in Windows 10 Ask Insider
    Is there a way to create a keyboard shortcut to paste text?: Hi guys! I'm working on a project which involves a lot of typing. There's a word which is a struggle to type but that is common in this document. As I understand it keyboard shortcuts are generally used to open apps or programs but is there a way to set a shortcut (for...
  6. creating shortcut key for missing keyboard letter

    in Windows 10 Support
    creating shortcut key for missing keyboard letter: key broken on keyboard. thought i d kreate a shortkut to missing letter. managed to do it in word but not for other progs like email. assuming need to do it for windows 10 for that to work. advise appreshiated and that letter komes after 'b' and before 'd'... 151366
  7. Creating keyboard shortcut for typed text

    in Windows 10 Ask Insider
    Creating keyboard shortcut for typed text: I’m looking for a way to create a keyboard shortcut for phrases and sentences that I type frequently. For example, I have to often type the phrase, “Review complete: no changes needed.” I’m thinking of a keyboard shortcut that looks something like “Ctrl rc” or “Alt 5656.”...
  8. Creating Custom Keyboard Shortcuts to Control Volume

    in Windows 10 Customization
    Creating Custom Keyboard Shortcuts to Control Volume: Ok, been looking for a potential solution all morning. I'm wondering, is there's a simple keyboard shortcut that either exists or one I can create to mute the volume of the current app I have open without having to open the volume mixer? It's just slightly annoying when...
  9. Create Multipurpose batch file

    in Windows 10 Software and Apps
    Create Multipurpose batch file: Hope this is the correct sub forum for this.. Often use a variety of command line functions e.g. winver / netplwiz etc etc Is there a way of creating a batchfile to include multiple commands with a number option to select...would be so handy i.e. 1 Netplwiz 2 Winver...
  10. Creating Batch File to auto-set shortcuts, download/install programs.

    in Windows 10 Support
    Creating Batch File to auto-set shortcuts, download/install programs.: Hello All, My current employer has AD Roaming Profiles turned off due to sync issues between DC1 and DC2. Since I am not an admin on the network I'm unable to do this from an admin point, but I do have full control in my AD Profile. Due to roaming profile being turned...