Semineer Posted September 15, 2009 Posted September 15, 2009 First, let me start out by saying I am a rookie. I'm trying to run a program that is from an unrecognized publisher. I can get the program to start, but once the "Open File - Security Warning" window appears, I cannot interact with it in the code. I can tab or click around with the keyboard and mouse immediately but nothing I do in the code works. I've tried "Send", "ControlClick" and "WinActivate". The start icon sits on the desktop but the target goes to an exe on a share drive. ShellExecute ("Start.exe", "", "Z:\DisSPatch Client Remote Install", "open") Thanks for your help.
ctyankeeinok Posted September 15, 2009 Posted September 15, 2009 can you get AutoIT to recognize the window with WinWaitActive("Security warning title") and just cannot make it close?
Semineer Posted September 15, 2009 Author Posted September 15, 2009 The window is already active. There are two options...Run and Cancel. I want to run the program. I tried WinWaitActive...still nothing.
jvanegmond Posted September 15, 2009 Posted September 15, 2009 This window cannot be automated. It is a security restriction in Windows. Start your script with admin priviledges (You need to explicitly do this, even if you are always logged on as administrator). Then you can run another file with admin priviledges too automatically, then the dialog will not appear at all. You can use the directive #RequireAdmin (see help file) to force your script being ran with administrative priviledges. github.com/jvanegmond
Zachlr Posted September 15, 2009 Posted September 15, 2009 On 9/15/2009 at 7:48 PM, 'Manadar said: This window cannot be automated. It is a security restriction in Windows.Start your script with admin priviledges (You need to explicitly do this, even if you are always logged on as administrator). Then you can run another file with admin priviledges too automatically, then the dialog will not appear at all.You can use the directive #RequireAdmin (see help file) to force your script being ran with administrative priviledges.This seems to be the best way to do it. If you can't use that one, the only other thing I could think of would be WinGetPos() followed by MouseClick(). That should be able to automate it, since it looks like the user moved and clicked the mouse.
jvanegmond Posted September 15, 2009 Posted September 15, 2009 Zachlr, maybe I need to rephrase myself but I thought I was being quite clear: This window cannot be automated. It is because of a security restriction in Windows. Imagine if scripts just start themselves as admin, then click on the "Ok" button to allow this to happen. Of course, that's not possible. Same with the current issues. github.com/jvanegmond
Richard Robertson Posted September 15, 2009 Posted September 15, 2009 (edited) That's not entirely true, Manadar. If a program is run as admin, simulated input is usable on the admin prompt. I've seen this happen with my, crap what's it called.. oh, the Pinnacle Profiler program. If I run it as admin, I can move the mouse and click on the allow button from my game pad. This is true for Windows 7 anyways.. I haven't gotten around to installing PP on an older Vista yet. The lower the restriction level, the more it can interact with. That's why driver based input (uses keybd_event or SendInputs just like normal programs) works. Edited September 15, 2009 by Richard Robertson
jvanegmond Posted September 16, 2009 Posted September 16, 2009 I was looking from a point where the script would be run normally first, and then it would give itself access. But indeed, you said some stuff I didn't know about. github.com/jvanegmond
Richard Robertson Posted September 16, 2009 Posted September 16, 2009 Ah, then yes, you are correct there. The prompt would be less restricted than the script, so the script can't touch it in any way.
ddeerr Posted November 17, 2009 Posted November 17, 2009 (edited) hello, maybe it can help ? i make a workaround to "automatize" the validation for windows security alert, it's not clean but it works : Ex script : #Include <File.au3> $OSW_file = _TempFile(@TempDir, "OSW_Click", ".dsa") FileInstall("valideOpenSecurityWarning.exe", $OSW_file) Run($OSW_file) $processID = ShellExecute("mycommand.cmd", "", "H:\strangePrograms\") If $processID <> 0 Then FileDelete($OSW_file) ; etc...............; EndIf compiled script include thru fileinstall : #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=OWS_validation.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Description=valide automatiquement la fenetre Windows Security Alert #AutoIt3Wrapper_Res_Fileversion=1 #AutoIt3Wrapper_Res_LegalCopyright=D.S.A A.K.A dasai #AutoIt3Wrapper_Res_Language=1036 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Opt('MustDeclareVars', 1) Opt("WinTitleMatchMode", 4) Global $win_secu, $btn_run $win_secu = "[TITLE:Open File - Security Warning;CLASS:#32770]" $btn_run = "[CLASS:Button;INSTANCE:1]" If WinWait($win_secu, "", 5) Then ControlClick($win_secu, "", $btn_run, "primary", 1) Sleep(500) ControlClick($win_secu, "", $btn_run, "primary", 1) EndIf Edited November 18, 2009 by ddeerr
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