Jump to content
Sign in to follow this  
francisv

ShellExecuteWait parameter is incorrect ?

Recommended Posts

francisv

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

line

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.

Thanks

The lines I use now are:

ShellExecuteWait ("dsl.lnk")

ShellExecuteWait ("PCAGO.LNK")

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

exit

Share this post


Link to post
Share on other sites
Nahuel

That's weird... the error I get is that it can't find the shortcut. I suppose you could try this:

ShellExecuteWait (@ScriptDir&"\dsl.lnk")

Or

ShellExecuteWait (@DesktopDir&"\dsl.lnk")

Share this post


Link to post
Share on other sites
francisv

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

Share this post


Link to post
Share on other sites
Ascend4nt

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:

http://www.autoitscript.com/forum/index.php?showtopic=69868

Edited by ascendant

Share this post


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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.