{"id":5089,"date":"2021-11-12T10:44:01","date_gmt":"2021-11-12T10:44:01","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=5089"},"modified":"2021-11-12T10:44:26","modified_gmt":"2021-11-12T10:44:26","slug":"sendkeys-for-windows-security-login-window-problem","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/sendkeys-for-windows-security-login-window-problem\/29317.html","title":{"rendered":"SendKeys For Windows Security Login Window Problem"},"content":{"rendered":"<p>I have outdated and no-longer-supported Axis brand security cameras that I have to access via the their IP addresses on my local LAN. When I point Internet Explorer to their IP addresses a &#8220;Windows Security&#8221; small window pops up requesting username and password, which I then enter and then I can get into the security camera. I am trying to automate this with a 1-button click using my extremely limited programming skills. I got it to work &#8212; kind of &#8212; using the following code, but the problem is that if the camera has been logged into recently then it doesn&#8217;t ask for username and password and consequently the SendKeys function has Internet Explorer search the web for the pre-programmed password because it puts the password on the address bar\/search of the browser rather than sending the password text to the Window Security window which isn&#8217;t there. Is there a way to fix this or do this better than my stupid way? I will paste the code below, but is there a better language that I should be using than Visual Basic for which I could download the programming environment? I have a feeling someone out there could write this entire code over and in a better way in 10 seconds than what I came with below that took me several hours (embarrassed!):<\/p>\n<p>Sub Button1_Click()<br \/>\n&#8216;<br \/>\n&#8216; Button1_Click Macro<\/p>\n<p>Set oIE = CreateObject(&#8220;InternetExplorer.Application&#8221;)<\/p>\n<p>sUsername = &#8220;user123&#8221;<br \/>\nsPassword = &#8220;password123&#8221;<\/p>\n<p>Set oIE = CreateObject(&#8220;InternetExplorer.Application&#8221;)<br \/>\noIE.Visible = True<\/p>\n<p>oIE.navigate &#8220;10.114.143.55&#8221;<\/p>\n<p>Application.Wait Now + TimeSerial(0, 0, 3)<\/p>\n<p>SendKeys sUsername &amp; &#8220;{TAB}&#8221;<\/p>\n<p>Application.Wait Now + TimeSerial(0, 0, 1)<\/p>\n<p>SendKeys sPassword &amp; &#8220;{ENTER}&#8221;<\/p>\n<p>End Sub<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":66},"question-category":[55],"question_tags":[],"class_list":["post-5089","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/5089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=5089"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=5089"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=5089"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=5089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}