Page 1 of 1
Unable to obtain command headers.
Posted: Wed Dec 28, 2016 11:15 am
by SebSpiers
Hi Guys,
So I've got an issue with the Create Shortcut function, it seems to be throwing up a runtime error.
"Unable to obtain command headers. Please rebuild your project."
My question simply is, what are command headers? and how do I resolve this issue?
The Create Shortcut I'm trying to do is very simple:
Code: Select all
Create Shortcut C:\Users\Public\Desktop\Software Name to C:\Program Files (x86)\Software Vendor\Software Name\Software.exe, Pin to Start Menu
Any ideas?
Re: Unable to obtain command headers.
Posted: Wed Dec 28, 2016 12:59 pm
by FrancescoT
Dear SebSpiers,
for what I see your Create Shortcut statement is not correct.
I suggest you to have a look at the "Shortcuts sample" from;
viewtopic.php?f=2&t=6772
Regards
Re: Unable to obtain command headers.
Posted: Wed Jan 04, 2017 8:48 am
by SebSpiers
FrancescoT wrote:for what I see your Create Shortcut statement is not correct.
I suggest you to have a look at the "Shortcuts sample" from;
viewtopic.php?f=2&t=6772
Looking at the example the only differences that I can see are that:
1. I'm not trying to Run as Administrator
2. I am manually specifying the location in which I would like the shortcut placed
This should work, no?
Re: Unable to obtain command headers.
Posted: Wed Jan 04, 2017 9:53 am
by SebSpiers
I have reviewed the documentation here:
https://www.installaware.com/FlashHelp/ ... ortcut.htm
I am only specifying values for:
1. Shortcut to File - which I can confirm is correct, I can launch the application using the value in the Run dialog box.
2. Link Name - this is just a text value, so should not have any impact at all?
3. Link Location - This is set to "C:\Users\Public\Desktop" - which is for all users.
Windows Size set to Normal.
Everything else is unchecked and/or empty.
Any thoughts?
Re: Unable to obtain command headers.
Posted: Wed Jan 04, 2017 12:10 pm
by FrancescoT
Dear SebSpiers,
for sure there is an error somewhere with the approach you used...however, without having your exact code it's quite difficult to say where this could be.
As I said previously, I suggest you to replicate in your code how the shortcut gets created by the sample. Of course, you don't need to specify any "Run as Administrator" option.
Regards
Re: Unable to obtain command headers.
Posted: Thu Jan 05, 2017 7:20 am
by SebSpiers
I solved this using a compressed vbs script to create the shortcut.
vbscript (mkshortcut.vbs)
Code: Select all
set WshShell = WScript.CreateObject("WScript.Shell" )
set oShellLink = WshShell.CreateShortcut(Wscript.Arguments.Named("shortcut") & ".lnk")
oShellLink.TargetPath = Wscript.Arguments.Named("target")
oShellLink.WindowStyle = 1
oShellLink.Save
Used like this:
Code: Select all
Extract 7Zip Archive $SUPPORTDIR$\mkshortcut.zip into folder C:\TempRun Program C:\Temp\mkshortcut.vbs /target:"C:\Program Files (x86)\XXXXXXXXXXX\XXXXXXXXXXX.exe" /shortcut:"XXXXXXXXXXX" (WAIT)
Run Program cmd /c copy "C:\Temp\XXXXXXXXXXX.lnk" "C:\Users\Public\Desktop" /y (WAIT)