Jump to content

Open File - Security Warning Screen


Semineer
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Richard Robertson
Link to comment
Share on other sites

  • 2 months later...

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 by ddeerr
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...