francisv Posted October 15, 2007 Share Posted October 15, 2007 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 Link to comment Share on other sites More sharing options...
Nahuel Posted October 15, 2007 Share Posted October 15, 2007 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") Link to comment Share on other sites More sharing options...
francisv Posted October 15, 2007 Author Share Posted October 15, 2007 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 comment Share on other sites More sharing options...
Ascend4nt Posted April 27, 2008 Share Posted April 27, 2008 (edited) 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 April 27, 2008 by ascendant My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now