Noviceatthis Posted September 17, 2014 Share Posted September 17, 2014 Hello all, $open = DllOpen("Shell32.dll") DllCall($open , "int" , "ShellExecuteW" , _ "HWND" , "NONE" , _ "wstr" , "open", _ "wstr" , *filepath* , _ "wstr" , "NONE" , _ "wstr" , "NONE" , _ "int" , "1") DllClose($open) So I've been tinkering with the code above, and for the most part it works, however, when the filepath leads to an au3 script, it doesnt run the script, it instead opens it in scite editor. Of course when I compile the script this is no longer a problem. I was just wondering why this happens when the script is not compiled. Thanks in advance Link to comment Share on other sites More sharing options...
MikahS Posted September 17, 2014 Share Posted September 17, 2014 (edited) It's because when you ran the SciTE installer you set it to edit scripts instead of run them. Edited September 17, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
jdelaney Posted September 17, 2014 Share Posted September 17, 2014 You can modify that here: C:Program Files (x86)AutoIt3SciTESciTEConfigSciteConfig.exe IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Noviceatthis Posted September 17, 2014 Author Share Posted September 17, 2014 (edited) @MikahS & @jdelaney Thanks for the speedy replies Yeah, thats what I thought, but the default action for .au3 files under Scite config is set to Run : Edited September 17, 2014 by Noviceatthis Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2014 Share Posted September 17, 2014 .au3 is associated with scite is why, don'r have help file handy to see id shellexecute can change verb, but look into it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Noviceatthis Posted September 17, 2014 Author Share Posted September 17, 2014 Thanks JohnOne, i will look into it Link to comment Share on other sites More sharing options...
Solution funkey Posted September 17, 2014 Solution Share Posted September 17, 2014 (edited) Use this:Global $open = DllOpen("Shell32.dll") DllCall($open , "int" , "ShellExecuteW" , _ "HWND" , 0, _ "ptr" , 0, _ ;use default verb "wstr" , "Test.au3" , _ "ptr" , 0, _ "ptr" , 0, _ "int" , 1) DllClose($open)Edit: Or this:Global $open = DllOpen("Shell32.dll") DllCall($open , "int" , "ShellExecuteW" , _ "HWND" , 0 , _ "wstr" , "Run", _ "wstr" , "Test.au3" , _ "ptr" , 0, _ "ptr" , 0, _ "int" , 1) DllClose($open) Edited September 17, 2014 by funkey Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Noviceatthis Posted September 18, 2014 Author Share Posted September 18, 2014 Thank you funkey, works perfectly Link to comment Share on other sites More sharing options...
funkey Posted September 18, 2014 Share Posted September 18, 2014 Thank you funkey, works perfectly You are welcome, but why not use inbuild ShellExecute() function? trancexx 1 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Noviceatthis Posted September 20, 2014 Author Share Posted September 20, 2014 @funkey Well I was just practising the DllCall function, still trying to get to grips with these Dll functions. 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