Windows 10: how to add powershell batch file shortcut to taskbar

Discus and support how to add powershell batch file shortcut to taskbar in Windows 10 Support to solve the problem; 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... Discussion in 'Windows 10 Support' started by robocop, Oct 12, 2019.

  1. robocop Win User

    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 taskbar? (the option it does offer is that I can pin the shortcut to one of my other items on the taskbar - but that kind of hides it, and I require it placed on it's own)

    Thank you

    Matt

    :)
     
    robocop, Oct 12, 2019
    #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, Oct 12, 2019
    #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 add powershell batch file shortcut to taskbar 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 add powershell batch file shortcut to taskbar :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, Oct 12, 2019
    #3
  4. how to add powershell batch file shortcut to taskbar

    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, Oct 12, 2019
    #4
Thema:

how to add powershell batch file shortcut to taskbar

Loading...
  1. how to add powershell batch file shortcut to taskbar - Similar Threads - add powershell batch

  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 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....
  5. 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...
  6. How to add website shortcut to taskbar ?

    in Windows 10 Ask Insider
    How to add website shortcut to taskbar ?: Windows 10 Home submitted by /u/AK_00l [link] [comments] https://www.reddit.com/r/Windows10/comments/l1dupa/how_to_add_website_shortcut_to_taskbar/
  7. 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...
  8. Batch Numbering Files through Powershell

    in Windows 10 Network and Sharing
    Batch Numbering Files through Powershell: Hello, I'm trying to come up with a solution through Powershell that batch numbers files at the beginning of a file name without interrupting the rest of the file name. For example: Current File Names: John Smith.pdf Abel Anderson.pdf Mary Trinity.pdf ..... Rocky...
  9. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  10. How to run batch file with powershell

    in Windows 10 Network and Sharing
    How to run batch file with powershell: I created a basic batch file that uses "net share" to share a local path. I saved the batch file. When I double click the file I get "access is denied"... note, I am logged on as a admin. Anyways... I figure it has to be run using power shell. I do not know much about...