jaberwacky Posted July 25, 2013 Share Posted July 25, 2013 (edited) I've been at this for about two weeks now. I can not for the life of me open an exe! Here is the function that calls the exe: Func scite4au3_model_update_context_menu_entries(Const $this, Const ByRef $context_menu_selections) Local Const $autoit_directory = ' ' & $this.GetAutoItDirectory() & ' ' local const $definition = $this.GetLoadedDefinition() & ' ' Local Const $command = $autoit_directory & $definition & $this.EnableDisableContextMenuItems($context_menu_selections) Switch IsAdmin() Case True RunWait($this.StorageDirectory & "SciTE4AutoIt3\ContextMenuAdmin.exe" & $command, '', @sw_hide) Case False RunWait($this.StorageDirectory & "SciTE4AutoIt3\ContextMenuNonAdmin.exe" & $command, '', @sw_hide) EndSwitch EndFunc Here is the code in the exe: #AutoIt3Wrapper_testing=y #NoTrayIcon #RequireAdmin Run(@ScriptDir & "\ContextMenu.exe " & command(), '', @sw_show) func command() local $command = '' for $argument in $CmdLine $command &= $argument next return $command endfunc I've confirmed that the paths are correct. I can click on the exe and it will execute. Any ideas? Edit: Windows 7 x64. AutoIt Production and Beta. Edit: More Iinfo I know the $this object is good because the script wouldn't run at all. $autoit_directory = C:\Program Files (x86)\AutoIt3\ $definition = BETA $command = C:\Program Files (x86)\AutoIt3\ BETA "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False" D:\Programming\AutoIt\My Scripts\SciTE4AutoIt3 Customizer\SciTE Customization GUI\SciTE4AutoIt3\ContextMenuNonAdmin.exe C:\Program Files (x86)\AutoIt3\ BETA "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False" Edited July 25, 2013 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
kylomas Posted July 25, 2013 Share Posted July 25, 2013 jaberwocky6669, This is going to sound stupid but, have you verified that "$autoit_directory", "$command" and "$definition" all have valid values? These look like they are derived from an object ($this) but I don't see any error checking that a valid object was passed. Secondly, you might try putting parm #1 of your runwait command in a variable and dumping it to make sure that it is formatted correctly. Apologies if I'm just wasting your time!!! kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
jaberwacky Posted July 25, 2013 Author Share Posted July 25, 2013 (edited) Who dares disturb my brain fog? Oh, for it it tis only kylomas. Heh. I know the object is good because the script wouldn't run at all. $autoit_directory = "C:Program Files (x86)AutoIt3" $command = "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False" $definition = BETA D:ProgrammingAutoItMy ScriptsSciTE4AutoIt3 CustomizerSciTE Customization GUISciTE4AutoIt3ContextMenuNonAdmin.exe "C:Program Files (x86)AutoIt3" Beta "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False" Edited July 25, 2013 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
kylomas Posted July 25, 2013 Share Posted July 25, 2013 Sorry...I'll go back to sleep now... Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
jaberwacky Posted July 25, 2013 Author Share Posted July 25, 2013 Thank you for your help, kylomas. I appreciate it. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
kylomas Posted July 25, 2013 Share Posted July 25, 2013 You're welcome, but I can't hear you, I'm sleeping!!! Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
jaberwacky Posted July 25, 2013 Author Share Posted July 25, 2013 Is it that Run() cannot open an exe that requires admin rights without already having admin escalation? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
abberration Posted July 26, 2013 Share Posted July 26, 2013 Is it that Run() cannot open an exe that requires admin rights without already having admin escalation? I have been working on a problem with admin rights for a while now. It concerns Cisco VPN software on Win7 (I never had this problem in XP). Not joined to the domain, AutoIt can launch my program and everything works fine. Joined to the domain (even using a Domain Admin account), Cisco VPN hangs for a long time to and never works properly. Even using RunAs with local or domain admin credentials does not help. However, when I create an executable to launch it with just a normal Run command and launch that executable using local admin rights, everything works perfectly. I have tried so many things to make this work, but the only one that produces good results is the two executable scenario where the first one runs the second one with local admin rights. It took me months to figure this much out. I'm just glad I got something working because I have to change everyone out from XP to Win7 soon. Failure is not an option. Hope this helps. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2013 Share Posted July 26, 2013 What if you type your runwait string into command line or search box, does that work? 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...
jaberwacky Posted July 26, 2013 Author Share Posted July 26, 2013 Beast! It works doing that manually! So, I guess that means my runwait string is properly formatted. Must be an autoit issue? I noticed that when I run the main script with #requireadmin then I get auac prompt but no GUI. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2013 Share Posted July 26, 2013 How about if you format it like this "'" & $this.StorageDirectory & "SciTE4AutoIt3ContextMenuAdmin.exe" & $command & "'" Adding single quote around the whole statement. 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...
jaberwacky Posted July 26, 2013 Author Share Posted July 26, 2013 Nada. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? 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