Aarstad Posted May 27, 2013 Share Posted May 27, 2013 (edited) Hey, so I have created a script that upon detection of iexplore.exe process (internet explorer) it will ask for an input password: If ProcessExists ("iexplore.exe") Then WinWait ("[CLASS:IEFrame]") WinSetState ("[CLASS:IEFrame]", "", @SW_HIDE ) Local $pw = InputBox ("Passord", "Admin passord:", "", "*") If $pw = $passwordaccept Then WinSetState ("[CLASS:IEFrame]", "", @SW_SHOW ) ProcessWaitClose ("iexplore.exe") Else WinSetState ("[CLASS:IEFrame]", "", @SW_SHOW ) ProcessClose ("iexplore.exe") MsgBox(0, "Feil passord!", "Det er forbudt å surfe med denne maskinen.") sleep (100) EndIf EndIf As you can see, there is a slight logical flaw with it. Whenever user attempts to open a process the window will be hidden and a password will be requested, however since the script pauses at inputbox the user can just open internet explorer again and ultimately bypass the script. Is it possible to have the inputbox on screen, but while it´s there the script doesn´t pause and keep searching for iexplore.exe windows? I am most certain there is an easier way to accomplish this, but I don´t know of any. Care to help out? Thanks. Edited May 27, 2013 by Aarstad Link to comment Share on other sites More sharing options...
Nessie Posted May 27, 2013 Share Posted May 27, 2013 (edited) You should not use any blocking function to do what you want. If you put an Inputbox or a MsbBox your script will simple be paused until the user press a button, Hi! Edited May 27, 2013 by Nessie My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
JohnOne Posted May 27, 2013 Share Posted May 27, 2013 This is one of those subjects where you need to make your endgame clear. You already know you can not use an inputbox, so you exact goal is the next step toward achieving what you want. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
MouseSpotter Posted May 27, 2013 Share Posted May 27, 2013 I think you are almost there with this ... Maybe this could help: Hide the IE window Show the password dialog Unhide the IE window on success Kill the IE process if password fails a certain number of times Link to comment Share on other sites More sharing options...
JohnOne Posted May 27, 2013 Share Posted May 27, 2013 I think you are almost there with this ... Maybe this could help: Hide the IE window Show the password dialog User simply opens up another instance of IE here Unhide the IE window on success Kill the IE process if password fails a certain number of times AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Neutro Posted May 27, 2013 Share Posted May 27, 2013 Hey, You could try to do this: create 1 script that will look if Iexplore process is launched. When it is, this script will look if a hidden text file exist on the hard drive of a computer. If this file doesn't exist, it will close Iexplore process and launch another independant script that will be asking for the password (if not already showing). This independant script will create the text file in a hidden location on the computer when the correct password is entered. If the text file exists when Iexplore is launched, it won't close it. When all Iexplore process are closed after correct password was entered, the hidden file is deleted by script n°1. Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
JohnOne Posted May 27, 2013 Share Posted May 27, 2013 can you not just set a password for IE with content advisor? You could try one of the following to invoke it, if it is not present in IE settings. ;DllCall("Msrating.dll", "long", "RatingSetupUI", "HWND", 0, "str", @UserName) ;Run("RunDll32.exe msrating.dll,RatingSetupUI") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Draygoes Posted May 28, 2013 Share Posted May 28, 2013 Well, one of the 2 ways that I was thinking of was already mentioned in this thread. The (slightly) harder way would be to create an input box yourself in the forum of GUICreate, and a couple of objects. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
MouseSpotter Posted May 28, 2013 Share Posted May 28, 2013 Link to comment Share on other sites More sharing options...
Aarstad Posted May 29, 2013 Author Share Posted May 29, 2013 Great amount of replies, guys. I am thankful for the help. I did manage to create a workaround based off of what Neutro replied. May not be the perfect or even proper coding advice or technique, but at least it gets the job done through "complex simplicity". Thanks bud!This is one of those subjects where you need to make your endgame clear. You already know you can not use an inputbox, so you exact goal is the next step toward achieving what you want. I am not sure where you're going here. Care to elaborate on that? Even though it's solved I really want to improve my standards, so in the future I can make fully functional programs. can you not just set a password for IE with content advisor?You could try one of the following to invoke it, if it is not present in IE settings.;DllCall("Msrating.dll", "long", "RatingSetupUI", "HWND", 0, "str", @UserName);Run("RunDll32.exe msrating.dll,RatingSetupUI") The content advisor requires that I would have to do that individually on every pc, unlesss there is a software that allows one to do all that in one blow. Knowing how computers work, I am certain there are a number of ways to solve that. But that would require the same workaround for different browsers such as firefox, chrome, opera and a heap of other browsers. Simply including their processnames in a file checker and disabling them felt like a better approach. Would the dialog prevent pausing the script? If thats the case it would be great to use something for that the next time. Hey, You could try to do this: create 1 script that will look if Iexplore process is launched. When it is, this script will look if a hidden text file exist on the hard drive of a computer. If this file doesn't exist, it will close Iexplore process and launch another independant script that will be asking for the password (if not already showing). This independant script will create the text file in a hidden location on the computer when the correct password is entered. If the text file exists when Iexplore is launched, it won't close it. When all Iexplore process are closed after correct password was entered, the hidden file is deleted by script n°1. I had something like that in mind. In fact, the workaround is almost an exact replica of what you wrote. Creating a new process just like that could be fatal if someone knew how to properly use their computer, but till that time this is a simple yet effective solution. I even named it something bizarre to act like a system process. Hiding the system process name would work as well, but I doubt that would be possible with autoit. Link to comment Share on other sites More sharing options...
MouseSpotter Posted May 29, 2013 Share Posted May 29, 2013 Would the dialog prevent pausing the script? If thats the case it would be great to use something for that the next time. Yes ... because you would make your own password dialog using GUICREATE and detect extra IE windows in the While event loop. Link to comment Share on other sites More sharing options...
hiho Posted May 29, 2013 Share Posted May 29, 2013 Well, here's a script which is very crude, but very agressive. You've got only one chance - if you write down wrong password, then no IE will be allowed to ru. I'm sure someone can improve it. Global $passwordaccept = "a" While 1 IE() WEnd Func IE() Do Sleep(100) Until ProcessExists("iexplore.exe") If ProcessExists("iexplore.exe") Then WinWait("[CLASS:IEFrame]") WinSetState("[CLASS:IEFrame]", "", @SW_HIDE) WinSetState("[CLASS:IEFrame]", "", @SW_DISABLE) Local $pw = InputBox("Passord", "Admin passord:", "", "*") Do If $pw = $passwordaccept Then WinSetState("[CLASS:IEFrame]", "", @SW_SHOW) WinSetState("[CLASS:IEFrame]", "", @SW_ENABLE) ProcessWaitClose("iexplore.exe") Else Kill() EndIf Until $pw = $passwordaccept EndIf EndFunc ;==>IE Func Kill() Do ProcessClose("iexplore.exe") Until ProcessExists("iexplore.exe") MsgBox(0, "Feil passord!", "Det er forbudt a surfe med denne maskinen.") EndFunc ;==>Kill Link to comment Share on other sites More sharing options...
Aarstad Posted June 1, 2013 Author Share Posted June 1, 2013 Well, here's a script which is very crude, but very agressive. You've got only one chance - if you write down wrong password, then no IE will be allowed to ru. I'm sure someone can improve it. Global $passwordaccept = "a" While 1 IE() WEnd Func IE() Do Sleep(100) Until ProcessExists("iexplore.exe") If ProcessExists("iexplore.exe") Then WinWait("[CLASS:IEFrame]") WinSetState("[CLASS:IEFrame]", "", @SW_HIDE) WinSetState("[CLASS:IEFrame]", "", @SW_DISABLE) Local $pw = InputBox("Passord", "Admin passord:", "", "*") //User can ignore the inputbox from here Do If $pw = $passwordaccept Then WinSetState("[CLASS:IEFrame]", "", @SW_SHOW) WinSetState("[CLASS:IEFrame]", "", @SW_ENABLE) ProcessWaitClose("iexplore.exe") Else Kill() EndIf Until $pw = $passwordaccept EndIf EndFunc ;==>IE Func Kill() Do ProcessClose("iexplore.exe") Until ProcessExists("iexplore.exe") MsgBox(0, "Feil passord!", "Det er forbudt a surfe med denne maskinen.") EndFunc ;==>Kill Hey, thanks for the script, but sadly its just a longer version of what I already created. It doesn't improve upon it. See where I wrote the text beneath the inputbox in the quoted code you added? This is the problemspot. Because inputbox will ask for a password and wait for a full eternity for an answer here, the user can just open another instance of internet explorer and ignore the inputbox all together. Again, thanks for the script and you taking your time, though. Link to comment Share on other sites More sharing options...
JohnOne Posted June 1, 2013 Share Posted June 1, 2013 the user can just open another instance of internet explorer and ignore the inputbox all together. The user can also ignore your script altogether and close it I suppose. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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