-1

I tried use powershell but does not work. How to create complex a desktop shortcut for two exe file from a batch file with path target format as below;

C:\ProgramData\RAD\dataset.exe S\W\T 11:20 "C:\Program Files\program\subp\prg.exe"

Thank you

Andre
  • 11
  • 6
  • 1
    Please [edit your question](https://stackoverflow.com/posts/56643729/edit) to show us the Powershell commands you've tried and failed with. – Compo Jun 18 '19 at 07:33
  • In this, `C:\ProgramData\RAD\dataset.exe S\W\T 11:20 "C:\Program Files\program\subp\prg.exe"` what is the "S\W\T 11:20" for? – shadow2020 Jun 18 '19 at 16:55
  • Possible duplicate of [How do I create a shortcut via command-line in Windows?](https://stackoverflow.com/questions/30028709/how-do-i-create-a-shortcut-via-command-line-in-windows) – shadow2020 Jun 18 '19 at 17:01

1 Answers1

1

Here's a which should create a which matches the target you provided, (just copy and paste to a new .cmd file and double click it).

;@Rundll32 advpack.dll,LaunchINFSection "%~0",,1
;@GoTo :EOF
[Version]
Signature="$Windows NT$"
[DefaultInstall]
ProfileItems=AddLnk
[AddLnk]
Name="ComplexShortcut",8,16
CmdLine=16419,RAD,"dataset.exe S\W\T 11:20 """C:\Program Files\program\subp\prg.exe"""
InfoTip="Executing a complex shortcut"
WorkingDir=1

I was unable to guess your second target, so you'll have to try your best to modify the solution yourself. I will not be updating this answer to provide further information or to cover things not asked at the time of the initial question.

Compo
  • 36,585
  • 5
  • 27
  • 39
  • @Andre, as a result of your short, non descriptive response, I've just copied and pasted the code from my answer above into a notepad `.cmd` document and ran it as a normal user under Windows Vista, 7 and 10. In all three it worked exactly as written and intended. – Compo Jun 19 '19 at 00:01