Reply to java security popup

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Reply to java security popup

19 Feb 2022, 22:53

Is there a way to automatically reply continue every time this thing pops up?
Attachments
java-warning.JPG
java-warning.JPG (20.29 KiB) Viewed 1720 times
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Reply to java security popup

19 Feb 2022, 23:29

See: https://www.effortz.com/add-website-browsers-trusted-sites-windows-os/
In order to avoid security warnings and other errors when using these and other applications, add them to your browser’s list of Trusted Sites / Exceptions. Follow the steps appropriate for your web browser.
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

19 Feb 2022, 23:34

I tried that, my company greys out some options so I can't change them, All i need to do is somehow make something to click continue every time this pops up, about 100 times a day..
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Reply to java security popup

19 Feb 2022, 23:47

If you are able to run AHK on your work computer you could easily use ImageSearch to find the button and Click to press it.
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

19 Feb 2022, 23:54

My goal is to have something that automatically click continue everytime this pops up, if i dont hit continue in time, it messes everything up and i have to start over
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

20 Feb 2022, 01:27

bobpic1961 wrote:My goal is to have something that automatically click continue everytime this pops up
Below is a script that runs forever, checking for that dialog box once every TimeCheckInterval milliseconds (for example, 2000 means that it will look for that dialog once every two seconds). When it finds the correct Title, it checks for the website address in the dialog to make sure that it is the correct dialog, i.e., so that it doesn't catch a different Security Warning dialog. When it finds the right dialog, it sends the Tab key followed by the Enter key, which is the equivalent of clicking the Continue button, since the Cancel button comes up as the default. If you want to exit the script, i.e., stop it from looking for that dialog, right-click the system tray icon and click Exit. Regards, Joe

Code: Select all

#Warn,UseUnsetLocal ; warning on uninitialized variables
#NoEnv ; avoid checking empty variables to see if they are environment variables
#SingleInstance Force ; replace old instance immediately
SetBatchLines,-1 ; run at maximum speed
SendMode,Input ; faster and more reliable
SetTitleMatchMode,3 ; 1=>Starts With  2=>Contains  3=>Matches Exactly

Title:="Security Warning" ; change this if and when needed
Website:="https://esr3gckprd02.emc.com:443" ; change this if and when needed
TimeCheckInterval:=1000 ; milliseconds between checks - make it whatever you want

Loop ; run forever - exit via system tray icon
{
  If (WinExist(Title)) ; check if window exists
  {
    WinGetText,DialogText ; get all the text in the dialog
    If (InStr(DialogText,Website) ; see if this is the correct security warning
    {
      WinActivate ; activate window for Send
      Send,{Tab}{Enter} ; since Cancel is default, need to send a tab first to get to Continue
    }
  }
  Sleep,%TimeCheckInterval% ; wait until next check
}
Last edited by JoeWinograd on 20 Feb 2022, 14:38, edited 1 time in total.
User avatar
MrDodel
Posts: 96
Joined: 28 Apr 2021, 09:03
Location: Event Horizon

Re: Reply to java security popup

20 Feb 2022, 03:16

If accessing that URL is part of your daily function, your IT team should whitelist that URL for you via GPO. If they can't do that, I doubt you would be able to install AHK.
So much universe, and so little time. GNU Sir Terry.
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

20 Feb 2022, 06:22

I do run AHK, i have Version 1.1.33.06. if that makes it easier.
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

20 Feb 2022, 09:44

bobpic1961 wrote:i have Version 1.1.33.06
The script that I posted above for you will work fine with 1.1.33.06, although I tested it only on 1.1.33.10 (which is the latest, and I suggest you update to it). Regards, Joe
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

20 Feb 2022, 13:19

Thank You, is there a way to get this to work if website changes, sometimes the failover servers are running the app, i dont have a full list of them.
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

20 Feb 2022, 14:25

bobpic1961 wrote:is there a way to get this to work if website changes
That's why I made the Website a variable...so that it's very easy to change. That said, if you don't get these dialogs in any other case, simply remove the website check, like this:

Code: Select all

#Warn,UseUnsetLocal ; warning on uninitialized variables
#NoEnv ; avoid checking empty variables to see if they are environment variables
#SingleInstance Force ; replace old instance immediately
SetBatchLines,-1 ; run at maximum speed
SendMode,Input ; faster and more reliable
SetTitleMatchMode,3 ; 1=>Starts With  2=>Contains  3=>Matches Exactly

Title:="Security Warning" ; change this if and when needed
TimeCheckInterval:=10000 ; milliseconds between checks - make it whatever you want

Loop ; run forever - exit via system tray icon
{
  If (WinExist(Title)) ; check if window exists
  {
    WinActivate ; activate window for Send
    Send,{Tab}{Tab}{Enter} ; need two tabs to get to Continue button
  }
  Sleep,%TimeCheckInterval% ; wait until next check
}
Btw, note that I changed the interval from one second to 10 seconds in the code above. For performance reasons, you should make the time interval as large as possible without risking Cancel. For example, I have a variant of this script running on a system to keep Citrix active, where the interval is 60 seconds (TimeCheckInterval:=60000), because I know that Citrix won't kill the session in only a minute. Also, note that I added a WinActivate command, which should be there to make sure that the keystrokes go to that window. Regards, Joe
Last edited by JoeWinograd on 20 Feb 2022, 16:02, edited 1 time in total.
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

20 Feb 2022, 15:02

the continue button never gets depressed, i tried all different time settings
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

20 Feb 2022, 15:31

bobpic1961 wrote:
20 Feb 2022, 15:02
the continue button never gets depressed
When that dialog is on the screen (without the script running), what happens when you hit the Tab key, then the Enter key?
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

20 Feb 2022, 15:48

tab - enter does not do it, if i hit tab -tab -enter, the continue works
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

20 Feb 2022, 16:04

bobpic1961 wrote:
20 Feb 2022, 15:48
tab - enter does not do it, if i hit tab -tab -enter, the continue works
OK, I just modified the most recent script in my earlier post with a second Tab key (also fixed a copy/paste error that crept into the script). Based on your experience doing it manually, the script should work now. Regards, Joe
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Reply to java security popup

20 Feb 2022, 17:47

You may need to run Joe's script as admin since this is an OS security window that is most likely running elevated.
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

20 Feb 2022, 20:10

I just cant get this to run..
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

20 Feb 2022, 21:09

bobpic1961 wrote:I just cant get this to run
I need more information than that to troubleshoot the problem. What exactly happens?

A version of the script with some MsgBox commands for debugging is below. What MsgBox output do you get when you run it?

Code: Select all

#Warn,UseUnsetLocal ; warning on uninitialized variables
#NoEnv ; avoid checking empty variables to see if they are environment variables
#SingleInstance Force ; replace old instance immediately
SetBatchLines,-1 ; run at maximum speed
SendMode,Input ; faster and more reliable
SetTitleMatchMode,3 ; 1=>Starts With  2=>Contains  3=>Matches Exactly

Title:="Security Warning" ; change this if and when needed
TimeCheckInterval:=10000 ; milliseconds between checks - make it whatever you want

msgbox,4096,debug1,before loop`ntitle=%Title%`ninterval=%TimeCheckInterval%

Loop ; run forever - exit via system tray icon
{
  msgbox,4096,debug2,inside loop - before title check - iteration %A_Index%
  If (WinExist(Title)) ; check if window exists
  {
    msgbox,4096,debug3,found window`n%Title%
    WinActivate ; activate window for Send
    Send,{Tab}{Tab}{Enter} ; need two tabs to get to Continue button
  }
  Sleep,%TimeCheckInterval% ; wait until next check
}
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

21 Feb 2022, 16:47

https://ftp.emc.com/action/login?domain=ftp.emc.com&username=NAS3MbvBv1&password=8AB8w8kH8w

I put a short video up on this ftp that shows what is happening, the first time i did not have the script running and i clicked continue manually to show how it is supposed to work, then i started the script and it did not continue as it was supposed to.
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

21 Feb 2022, 17:31

In the video, did you run the script with the MsgBox debugging commands? If not, please do that and let me know what MsgBox output appears, if any (or post another video if that's easier for you).

After that, exit the script, then run this script:

Code: Select all

!^F10:: ; display active window title, class, process name, handle (and put it on clipboard)
WinGetTitle,Title,A
Handle:=WinExist("A")
WinGetClass,Class,A
WinGet,Process,ProcessName,A
Clipboard:="Title=" . Title . "`n`nClass=" . Class . "`n`nProcess Name=" . Process . "`n`nHandle=" . Handle
MsgBox,4160,Active Window,%Clipboard%
Return
As you can see, I made the hotkey Alt+Ctrl+F10, but, of course, you may change it to whatever you prefer. Now, perform the steps that result in getting the Security Warning dialog on the screen. To be sure it is the active window, click the title bar of the Security Warning dialog, then click the hotkey (Alt+Ctrl+F10 or whatever you made it). What does the MsgBox say? Or you may do a Paste, since the script puts the info on the clipboard. Regards, Joe

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], DecimalTurn, Google [Bot], macromint, peter_ahk and 351 guests