Mamatha Posted November 30, 2011 Share Posted November 30, 2011 My code is like this: Opt("WinTitleMatchMode", 2) Opt("WinTextMatchMode", 2) $file = "G:\Setup.exe" ShellExecuteWait($file) if @error then Msgbox(0,"Can't find the installer","M1 installer not found") exit endif WinWaitActive("M1 Setup") Send("!n") If i type alt-n manually it works ok I read this problem in this forum submitted by others but none of the solution seem to work on my machine can someone please help on this? Thank You Link to comment Share on other sites More sharing options...
Thornhunt Posted December 1, 2011 Share Posted December 1, 2011 (edited) did you try: compile it in 64bit run as administrator controlsend (sometimes send doesnt work) Another thing to check is, is it actually reaching the send stage? test by making a msgbox befor the send function Edited December 1, 2011 by Thornhunt Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D Link to comment Share on other sites More sharing options...
Mamatha Posted December 1, 2011 Author Share Posted December 1, 2011 When I compiled that script it produced exe file when I run that exe file as an administrator, it says "the specified path does not exist" The file did exist on the network drive If I run the script straight away it finds the file ok send and controlsend both doesn't work Link to comment Share on other sites More sharing options...
Mamatha Posted December 1, 2011 Author Share Posted December 1, 2011 Yes, I made a msgbox before the send function msgbox came up after winwaitactive but still not executing send function Link to comment Share on other sites More sharing options...
Thornhunt Posted December 1, 2011 Share Posted December 1, 2011 (edited) have you tried send("{ALTDOWN}") send("n") send("{ALTUP}") sorry i cant help too much im on my work laptop //edit lil i missed the "'s Edited December 1, 2011 by Thornhunt Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D Link to comment Share on other sites More sharing options...
Mamatha Posted December 1, 2011 Author Share Posted December 1, 2011 still doesn't work Thank you for your time anyway Link to comment Share on other sites More sharing options...
Thornhunt Posted December 1, 2011 Share Posted December 1, 2011 no problemmo, if i get one my pc in time when i get home then i'l be more help since that to runs win7 64bit but im sure someone here will fix it befor i do that lol Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D Link to comment Share on other sites More sharing options...
Tonnie Posted December 1, 2011 Share Posted December 1, 2011 On my Windows 7 Pro 64-bit the send function works, for both 32-bit and 64-bit compiled exe. I can confirm that using something like Send("!n") or for example Send("!{TAB}") works. In my experience sometimes the window 'is not ready to accept commands', even when WinWaitActive says the window is available. Maybe you could try Sleep(1000) right before the Send command to see if it makes any difference? This has worked for me in past. Link to comment Share on other sites More sharing options...
KaFu Posted December 1, 2011 Share Posted December 1, 2011 (edited) Take a look here at especially the part on User Interface Privilege Isolation (UIPI). If you want to run an installer this should trigger UAC and process elevation. That means your calling script definitly needs to run as admin. I think for debugging running the script with #requireadmin should work, for compiling you should set#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator Edited December 1, 2011 by KaFu  OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Mamatha Posted December 1, 2011 Author Share Posted December 1, 2011 I tried sleep(1000) right before the send command - still no luck Tried #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator - this one doesn't help either Please can someone help me as I am unable to go any further with my script, Thank You Link to comment Share on other sites More sharing options...
Mamatha Posted December 1, 2011 Author Share Posted December 1, 2011 Hey, It works for me when I add #requireadmin at the begining of my script Now my code looks like this #requireadmin Opt("WinTitleMatchMode", 2) Opt("WinTextMatchMode", 2) $file = "C:Setup.exe" ShellExecuteWait($file) if @error then Msgbox(0,"Error","installer not found") exit endif WinWaitActive("Setup") sleep(1000) ;MsgBox(0, "Welcome", "works") send("!n") exit Thank You very much 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