Create shortcut that runs a batch file

Question:

I want to create a powershell script that creates a shortcut in the windows 7 taskbar, that runs a batch file from cmd.exe.

Trying to do as told in these two posts:

  1. https://superuser.com/questions/100249/how-to-pin-either-a-shortcut-or-a-batch-file-to-the-new-windows-7-taskbar
  2. How to create a shortcut using Powershell

Basically I want to set a shortcut files Target property to be something like:

What I got so far in my powershell script is:

This results in the following error:

Anyone got any suggestions?

Answer:

Set the arguments via the Arguments property:

Source:

Create shortcut that runs a batch file by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply