Jump to content

ShellExecuteWait parameter is incorrect ?

Recommended Posts

I just started working with this script and am trying to do something that would seem to be simple.. what do I know..

I want to do the equivalent of starting two shortcuts then running a batch file. The first short cut

is for a DSL modem startup. When I double click the icon it works fine but if I add the


ShellExecuteWait ("dsl.lnk") to my script I get "The parameter is incorrect". I have a copy of the .lnk in the same

folder as the complied script. The properties for the link point to the dialup in network connections so I can't find

a c:\... type path to add.

Could this be due to my lack of path statements.

Haven't gotten to the other shortcut or .bat file yet because I really need the network logon done before the

other processes start.

This is on WinXP with AutoITv3.

Appreciate any help.


The lines I use now are:

ShellExecuteWait ("dsl.lnk")

ShellExecuteWait ("PCAGO.LNK")

RunWait ("Blatsend.bat","C:\AutoStuff")


Link to post
Share on other sites

Tried both of the lines you suggested and get parameter is incorrect on both.

From other references I've looked at it might have something to do with starting a network connection.

Still can't see how to determine a path for the .lnk. Windows shows it in control panel - network connections- dial up.

Never have figured out how that translates back to the DOS world.

Thanks for the suggestions

Link to post
Share on other sites
  • 6 months later...

Since I came across this in my search, I thought I'd suggest that maybe what you have is an MSI Installed 'Advertised Shortcut'. These can't be executed using ShellExecute() functions, and FileGetShortcut() calls will give you the wrong executable file (something of an install/shortcut-creation thing?). Anyway, this guy Prog@ndy came up with a clever way of getting around the issue and making an easy way to get shortcut information - a _FileGetShortcutEx() function. It returns the same array as FileGetShortcut(), but it goes the extra step of checking whether the shortcut is one of those MSI-Installed 'Advertised Shortcuts', and also seeing if the program is actually installed correctly.

Anyway, the code is here (in the General Help and Support forum in case the URL changes) with the topic:

" _FileGetShortcutEx for LNK files that are Advertised Shortcuts'

Here's the current URL:


Edited by ascendant
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...