Search the Community

Showing results for tags 'password'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Chat
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • Forum
  • AutoIt


  • Community Calendar

Found 24 results

  1. Recently, I am interested to build a windows app to reset Windows login password as a side off project. I am still a newbie in programming so i am not able to build the app from scratch. Is there any open source project i could learn from on this?
  2. I can not do anything with any user in the "Local Users Group" I tried from my account but I could not change my password (ie set new password)! But I was able to activate the Administrator account and I logged into the Administrator account and still could not do anything with my account! But I can set the password and disable the Administrator account from my account or Administrator. Any ideas? (Ignore the click on the Sign-in option in the Change Accout settings.)
  3. I'm a command-line kind of guy, and I write scripts primarily for myself. Since many websites nowadays require strong passwords, I thought I'd write a simple password generator in AutoIt. I know that AutoIt mavens have written more elaborate pw generators; I offer mine for what it's worth. The compiled script, GenPass.exe, can be downloaded here. See below for Help text and source. Enjoy! Updates: 2017-05-06: Default password changed to variable length of 13-22 characters; argument "1" no longer supported When compiled as GenPW.exe, password is sent directly to the clipboard, no message box unless password generation fails. 2017-05-05: Correction to bypass password generation if argument is ?|H|h 2017-05-03: Added special argument 1 to generate a password of variable length (10-18 characters) including two (2) separator characters 2017-05-02: Added option /S to set a (persistent) randomization seed Help: GenPass.exe|GenPW.exe -- CLD rev. 2017-05-06 Generate a strong password and save it to the Windows clipboard Note: GenPW.exe has the same functionality as GenPass.exe, but sends the generated password directly to the clipboard. No message box is displayed (unless password generation fails). "Strong" means that the password contains random combinations of alphnumeric characters, including at least one uppercase letter (A-N,P-Z), one lowercase letter (a-k,m-z), and one number (0-9). (Generated passwords do not use uppercase O or lowercase l as these characters are easily confused with the numbers 0 and 1.) The length of the password is up to you (see Usage, below), but needless to say, the longer, the stronger. By default, GenPass generates a strong password of between 13 and 22 characters that includes two of the following separator characters: $%&()*+,-./:;@[]_. Alternatively, you can supply a command-line argument in which any number n from 1 to 9 stands for a random sequence of alphanumeric characters of length n, and any other character stands for itself. Thus, you can include fixed words and other characters, such as separators, in the generated password. Spaces in the argument are converted to underscores. Here are some examples: Usage Sample output ----- ------------- GenPass MqU26A*6dS-53r8 GenPass 9 frdhPYDs9 GenPass 58 weoXYHKxDI1uQ GenPass 5.5 UfA6j.43VBB GenPass 3-4-3 0I0-6gq4-njc GenPass 5,3.7 I2FSR,tRZ.fjeIsFy GenPass 3)5(3 UMf)m8513(CBq GenPass 3[haha]3 yLa[haha]P3y GenPass Yes way5 Yes_way1BsUh Seed Option (/S) ---------------- Adding switch /S to the command-line argument causes GenPass to set a seed for the random generation of password characters. A bare /S sets a randomized seed which is written to disk in a file named GenPass.rnd; this seed is used for all subsequent launches of GenPass with the bare /S option. Alternatively, you can specify a seed (range -2^31 to 2^31-1) on the command line with /S [seed]. Here are some examples: GenPass /S GenPass /S 33.3333 GenPass 5,5,5 /S GenPass 5,5,5 /S 33.3333 Note that any subsequent launch of GenPass without the /S option will cause GenPass.rnd to be deleted. Source: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=GenPass.exe #AutoIt3Wrapper_UseUpx=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs GENPASS.AU3 -- AutoIt v3 CLD rev.2017-05-05 ------------------ Generate a strong password and save it to the clipboard >> Command GenPass ? for detailed help << ------------------------------------------------------- #ce #include <Clipboard.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> AutoItSetOption("WinTitleMatchMode", -4) FileInstall ("d:\path\GenPass.htm", @ScriptDir & "\GenPass.htm", $FC_OVERWRITE) ; Template/Seed Local $sTemp = "" Local $bSeed = False, $fSeed=False If $CmdLine[0] Then $sTemp = $CmdLineRaw If $CmdLine[$CmdLine[0]] = "/s" Then $bSeed = True $sTemp = StringTrimRight($sTemp, 2) $sTemp = StringStripWS($sTemp, $STR_STRIPTRAILING) EndIf If $CmdLine[$CmdLine[0] - 1] = "/s" Then $bSeed = True $fSeed = $CmdLine[$CmdLine[0]] $sTemp = StringTrimRight($sTemp, 3 + StringLen($fSeed)) $sTemp = StringStripWS($sTemp, $STR_STRIPTRAILING) EndIf EndIf If Not $sTemp Then $sTemp = "8" If $sTemp = "1" Then $aSeps = StringSplit("#$%&()*+,-./:;@[]_", "") $sTemp = String(Random(3,6,1)) & $aSeps[Random(1,$aSeps[0],1)] & _ String(Random(2,4,1)) & $aSeps[Random(1,$aSeps[0],1)] & _ String(Random(3,6,1)) EndIf $sFn = @ScriptDir&"\GenPass.rnd" If $bSeed Then If Not $fSeed Then If Not FileExists($sFn) Then $fSeed = Random(-1.999^31,1.999^31,0) $h=FileOpen($sFn,2) If $h > -1 Then FileWrite($h,$fSeed) FileClose($h) Else Exit MsgBox($MB_ICONWARNING, @ScriptName, "Error opening " & $sFn) EndIf Else $h=FileOpen($sFn) If $h > -1 Then $fSeed=FileRead($h) FileClose($h) Else Exit MsgBox($MB_ICONWARNING, @ScriptName, "Error opening " & $sFn) EndIf EndIf EndIf SRandom($fSeed) Else If FileExists($sFn) Then FileDelete($sFn) EndIf ; Show help If StringInStr("?Hh", $sTemp) Then If WinExists("[REGEXPTITLE:GenPass.exe:.*]") Then WinActivate("[REGEXPTITLE:GenPass.exe:.*]") Else ShellExecute(@ScriptDir & "\GenPass.htm") EndIf Exit EndIf ; Main $sTemp = StringReplace($sTemp, " ", "_") $iC = 1 While $iC < 10001 $sPW = GenPW($sTemp) If $sPW Then ClipPut($sPW) If Not StringInStr (@ScriptName, "GenPW") Then _ MsgBox($MB_ICONINFORMATION, @ScriptName, $sPW & _ " saved to clipboard" & @CRLF & @CRLF & _ @ScriptName & " ? shows detailed help") Exit Else $iC += 1 EndIf WEnd Exit MsgBox($MB_ICONWARNING, @ScriptName, "Password generation failed!") ;------------------------------- Func GenPw($sTemplate) Local $aIn = StringSplit($sTemplate,"") Local $sOut = "" Local $sABC = _ "0123456789ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz0123456789" Local $aAB = StringSplit($sABC, "") Local $bUC = 0, $bLC = 0, $bNR = 0 For $i = 1 To $aIn[0] If Int($aIn[$i]) Then $iK = $aIn[$i] For $j = 1 To $iK $iR = Random(1, $aAB[0],1) Select Case StringInStr("0123456789", $aAB[$iR]) $bNR = 1 Case StringInStr("ABCDEFGHIJKLMNPQRSTUVWXYZ", _ $aAB[$iR], $STR_CASESENSE) $bUC = 1 Case StringInStr("abcdefghijklmnpqrstuvwxyz", _ $aAB[$iR], $STR_CASESENSE) $bLC = 1 EndSelect $sOut &= $aAB[$iR] Next Else $sOut &= $aIn[$i] EndIf Next If ($bUC And $bLC And $bNR) Then Return $sOut Else Return 0 EndIf EndFunc
  4. ; Title .........: Password ; AutoIt Version : ; Description ...: UDF to work with passwords. Mostly ported from Javascript at and improved a bit ; Author(s) .....: Fenzik + Team Adaptech ; #CURRENT# ===================================================================================================================== ;_Password_Generate ;_Password_GetcharsetSize ;_Password_GetEntropy ;_Password_IsCommonWord ;_Password_Startup ; =============================================================================================================================== It's my first UDF so please be nice.:) If somebody have better idea how to store common dictionary and frequency table please post here... Have fun! Fenzik
  5. Hi guys, I have a pretty advanced question... This is the issue i'm facing : On a regular basis we need to install pfx certificates (with password protection) on devices from external companies. To install the certificate we always have to contact the user, setup a really dull and long process to get an RDP session to that device, install the certificate. I'm looking for : a way to generate exe files on the fly, that will include the pfx file and password, and automatically install them without any interaction from the user, and the user not being able to retrieve the password to install the certificate. Question : Is this possible with AutoIT? And if so, does anyone have a working example for the certificate installation part or the auto generate with file include? Thx in advance colombeen
  6. Hi Guys, Hope you're fine today! I'd like to create a small GUI that, when clicking a button, the password set in the GUICtrlCreateInput is revealed and when the click is released, the password is hidden again. W8/10 style in fact... Here's what I have so far: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) f_RemedyUpdate() While 1 Sleep(10) Wend Func f_RemedyUpdate() $gMailCreds = GUICreate("SEE CHECKLISTS", 300, 140) GUISetBkColor($Color_White) GUISetFont(8.5, 700, 0) GUICtrlCreateLabel("Password required for your account" , 5, 10) GUICtrlCreateLabel("Your Password:", 10, 70, 100, 30) $g_PassInput = GUICtrlCreateInput("", 110, 66, 150, 20, $ES_PASSWORD) GUICtrlSetColor(-1, 0x800080) $g_ShowPassButton = GuiCtrlCreateButton ("", 270, 67, 16, 16, $BS_ICON) GUICtrlSetImage(-1, "C:\eye.ico") GuiCtrlSetOnEvent ($g_ShowPassButton, "f_ShowPassword") $g_SubmitBtn = GUICtrlCreateButton ("Submit", 120, 100, -1, -1, $BS_DEFPUSHBUTTON) GUICtrlSetOnEvent(-1, "f_SendMail") GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") GUISetState(@SW_SHOW) EndFunc Func f_ShowPassword() $s_PWD = GuiCtrlRead ($g_PassInput) If $s_PWD = "" Then Msgbox (64, "Your password", "You did not type any password") Else Msgbox (64, "Your Password", "You typed --> " & $s_PWD & " <-- as password.") EndIf EndFunc I've enclosed the small ico file I'm using Thanks in advance for any help provided -31290 eye.ico
  7. I have code to enter password using the setting $ES_PASSWORD. It seems that with this setting you can't enter more than the letters that fill box. Can anyone tell me how to enter more characters? GUICreate("Password Test",500,200) $Input = GUICtrlCreateInput("Password",10,20,40,50,$ES_PASSWORD) GUISetState(@SW_SHOW,"Password Test") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_HIDE,"Password Test") ExitLoop EndSwitch WEnd If GUICtrlRead($Input) <> "" Then MsgBox(0,GUICtrlRead($Input),"Done") With this code you can only enter 4 characters of password.
  8. Hi, I am trying to log into using AutoIt. There are several examples, but none of them work with the current webpage. This is my code (because the username and password are not valid ;-) , I comment the "button click" out.): #include <IE.au3> Local $oIE = _IECreate("") _IELoadWait ($oIE) _IELinkClickByText($oIE, "Sign in") $o_form = _IEFormGetObjByName ($oIE, "f1") $o_login = _IEFormElementGetObjByName ($o_form, "loginfmt") $o_password = _IEFormElementGetObjByName ($o_form, "passwd") $o_signin = _IEFormElementGetObjByName ($o_form, "idSIButton9") $username = "" $password = "testpassword" _IEAction ($o_login, "focus") _IEFormElementSetValue ($o_login, $username) _IEFormElementSetValue ($o_password, $password) ;_IEAction ($o_signin, "click") When I run the code I get the following: The value being set is garbeled with "PlaceholderText". Because of this, the username and password are invalid. Here screenhot of the placeholders text: When you start typing in one of the fields, the placeholder text is automatically deleted. When you set a value it stays. I found a workaround, to set focus on the element and send the username as an keyboard input to the field, but I would like a clean solution based on variables. So, does anyone now how to do this?
  9. Hallo members, Looking for the right regex for password validation, the password must be eight characters long including at least 1 number and includes both lower and uppercase letters and at least 1 special character. € , £ and letters with umlauts, accents, etc. are not allowed. I have made a test gui with two different validations, this is just for testing purposes, but is this right way to do it? '((?=.*\d)(?=.*[A-Z])(?=.*\W).{8,8})'and '([A-Za-z: ]+\$([A-Z0-9]+)([\s]*[A-Za-z: ]+\$([A-Z0-9]+)){0,2})' The test GUI #NoTrayIcon #cs ---------------------------------------------------------------------------- AutoIt Version: Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Local $GUI, $Password, $Button1, $Button2 $GUI = GUICreate("Form1", 412, 261, 192, 124) $Password = GUICtrlCreateInput("", 96, 32, 193, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_PASSWORD)) GUICtrlSendMsg(-1, $EM_SETCUEBANNER, False, "8 characters") GUICtrlSetLimit(-1, 8, 8) $Button1 = GUICtrlCreateButton("Export", 97, 77, 193, 25) $Button2 = GUICtrlCreateButton("Import", 97, 123, 193, 25) GUISetState(@SW_SHOW) While 1 Local $StringPassw = GUICtrlRead($Password) Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; Export If $StringPassw = "" Then MsgBox(16, "Error!", "Password can not be empty") GUICtrlSetState($Password, $GUI_FOCUS) ; regex for testing, the password must be eight characters including one uppercase letter, one special character and alphanumeric characters. ElseIf StringRegExp($StringPassw, '((?=.*\d)(?=.*[A-Z])(?=.*\W).{8,8})') Then MsgBox(0, "Strong", "Password is 8 characters including 1 uppercase letter, 1 special character, alphanumeric characters") ; Debug ; Export() GUICtrlSetState($Button1, $GUI_DISABLE) Else MsgBox(64, "Password is not strong!", "Re-type password, Password must be 8 characters including 1 uppercase letter, 1 special character, alphanumeric characters") GUICtrlSetData($Password, "") EndIf Case $Button2 ; Import If $StringPassw = "" Then MsgBox(16, "Error!", "Password can not be empty") ; another regex for testing GUICtrlSetState($Password, $GUI_FOCUS) ElseIf StringRegExp($StringPassw, '([A-Za-z: ]+\$([A-Z0-9]+)([\s]*[A-Za-z: ]+\$([A-Z0-9]+)){0,2})') Then MsgBox(0, "Strong", "Password is 8 characters including 1 uppercase letter, 1 special character, alphanumeric characters") ; Debug ; Import() GUICtrlSetState($Button2, $GUI_DISABLE) Else MsgBox(64, "Password is not strong!", "Re-type password, Password must be 8 characters including 1 uppercase letter, 1 special character, alphanumeric characters") GUICtrlSetData($Password, "") EndIf EndSwitch WEnd searched the forum, but good not find a good example Edit; the password must be eight characters long including at least 1 number and includes both lower and uppercase letters and at least 1 special character. € , £ and letters with umlauts, accents, etc. are not allowed. I need only a single regular expression Thanks in advance
  10. Hi everyone, I'm building some script that will encrypt some user password and store it in an ini file. I'd like to recall the password in a putty session but I can't figure out how to decrypt it: So far, I have: Global $Images = "C:\SAC_IS\ATL_Laptop\Resources\Images\" Global $WorkingDir = "C:\SAC_IS\Switches_Toolbox\" Global $Settings = $WorkingDir & "\Settings.ini" DirCreate ($WorkingDir) _FirstRun() While 1 Sleep(10) WEnd Func _FirstRun() If FileExists ("C:\SAC_IS\Switches_Toolbox\Settings.ini") Then _LoginfoGUI() Else MsgBox (64, "PUTTY EXECUTABLE", "First, select PUTTY.EXE path") Global $PuttyPath = FileOpenDialog("Please indicate putty.exe path", @HomeDrive, "exe (*.exe)") _LoginfoGUI() If @Error Then Global $Error = MsgBox(21, "Error!", "Can't find PUTTY.EXE!"& @CRLF & "Click Retry or Cancel to Quit") If $Error = $IDRETRY Then _FirstRun() Else _Exit() EndIf Else FileInstall ("C:\Users\h74033\Desktop\Scirpts\Switches\Settings.ini", $WorkingDir & "\Settings.ini", 1) IniWrite ($Settings, "Putty", "Path", $PuttyPath) EndIf EndIf ; SwitchesToolboxGui() Endfunc Func _Exit() Exit EndFunc Func _LoginfoGUI() Global $LoginfoGUI = GUICreate("Switches Toolbox Configuration", 300, 300, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $LoginfoGUI) GUICtrlCreatePic ($Images & "\SAClogo.jpg", 30, 10, 240, 80) GUISetBkColor ($Color_White) GUICtrlCreateLabel("-- SWITCHES TOOLBOX --", 85, 100, 150, 25) GUICtrlSetFont (-1, 8.5, 700, 0) GUICtrlCreateLabel("Please provide required information:", 10, 130, 250, 25) GUICtrlCreateLabel("-Global ID:", 10, 170, 60, 30) GUICtrlSetFont (-1, 8.5, 700, 0) GUICtrlCreateLabel("-Password:", 10, 210, 70, 30) GUICtrlSetFont (-1, 8.5, 700, 0) Global $GIDInput = GUICtrlCreateInput("", 90, 168, 80, 20) Global $PassInput = GUICtrlCreateInput("", 90, 205, 150, 20, $ES_PASSWORD) GUICtrlCreateButton ("Submit", 100, 245, 100, 25) GUICtrlSetOnEvent(-1, "_Submit") GUISetState(@SW_SHOW) EndFunc Func _Submit() Global $GID = GuiCtrlRead($GIDInput) Global $EncryptedPwd = _Crypt_HashData (GuiCtrlRead($PassInput), $CALG_MD2) IniWrite ($Settings, "Username", "Gid", $Gid) IniWrite ($Settings, "Encryption", "Password", $EncryptedPwd) ;MsgBox(0, "re", $EncryptedPwd) EndFuncHow can I achieve that please? Thanks in advance
  11. Hi folks, I am struggling to read time from a remote machine. By initial probing i could find it is possible by WMI object and connectserver (if we need to user password, yes here i need to use another username and password) Please help me to sort this out. Any suggestions would be appreciated.
  12. I'm looking at a situation where a client has an application deployed via RemoteApp, no full RDP desktop or web interface available. As the RemoteApp is published on a network share, it is invoked via a batch file, launched via a published .rdp file. I've run into an issue with being able to allow users to change their own passwords. I don't want to have to deal with changing users passwords, or knowing what they are; if I expire or require a password change, the users are simply locked out, there is no opportunity for them to change their password themselves. Ideally, I'd like to write or find a command line utility I could insert into the batch file that launches the remote app to address this deficiency. I've poked around in the ActiveDirectory UDF, which seems to be a great tool, but without a function written for the use case where the password change is desired to be forced upon the current user ( who is NOT an admin). Note: net user / domain requires admin rights. pspasswd, while awesome, also requires admin rights. Does anyone have a UDF or Function utility that they use to allow a user to change their own domain password from the command line? I've seen a couple of powershell examples, but I'd love to be able to compile or drop in a command line oriented passwd.exe utility that would work similarly to the *nix equivalent. The pspasswd sysinternals utility does not seem to have this use case in mind -- in my tests you have to be an admin to change a password.
  13. This problem has been figured out. Was very easy and no need for this thread anymore.
  14. This is a simple incomplete password reset tool, my 3rd script with autoit, so the code is elementary. This is something you can use to customize and make your own. It will generate a password, and give you the nato readout so you can read it to an end user over the phone. Feel free to update and make it better, I no longer require it so enjoy! #include <File.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AD.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AD PAssword Reset Tool", 509, 276, 250, 152) $Label1 = GUICtrlCreateLabel("Password Reset Tool", 40, 8, 442, 46) GUICtrlSetFont(-1, 28, 400, 0, "Arial") GUICtrlSetColor(-1, 0x000000) Global $rnd, $result2 = "" $Input3 = GUICtrlCreateInput("", 60, 96, 400, 32, $SS_CENTER) GUICtrlSetFont(-1, 16, 400, 0, "Arial") GUICtrlSetState(-1, $GUI_DISABLE) $Button1 = GUICtrlCreateButton("Generate Password", 16, 64, 107, 25) $Button2 = GUICtrlCreateButton("Set Password", 260, 162, 75, 25) $Button3 = GUICtrlCreateButton("Unlock Account", 155, 162, 99, 25) $Input1 = GUICtrlCreateInput("", 16, 160, 121, 21) $Group1 = GUICtrlCreateGroup("Account status", 8, 188, 489, 81) $Label4 = GUICtrlCreateLabel("Username: ", 16, 204, 58, 17) $Label5 = GUICtrlCreateLabel("Locked: ", 16, 220, 46, 17) $Label6 = GUICtrlCreateLabel("Password Age:", 16, 236, 75, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label7 = GUICtrlCreateLabel("", 26, 133, 436, 24, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $z = "rvxs|rdmf|jzlr|izez|lbyl|yjmz|wzet|pyau|qumv|aocr|wwal|qhyh|dlou|ruqj|vgmg|edpg|wsmv|qmnt|kwgr|tduz|jzgq|ywdn|etet|hxvj|ydwp|vvzx|cwcs|fcru|dnin|jwna|pwks|xoak|audd|ppwe|omzq|xwcy|dudn|rwtz|qvtg|jgzi|hxkr|azug|ixla|iikl|ovgk|skpj|kldj|ovwg|psfy|jmck|gkea|bjmq|trfc|tppm|jvae|fgah|scbj|pqtl|gses|gtzz|xtid|snds|xkok|zgcb|iktk|cvil|ynxn|fqqs|qakc|cnsc|jiaz|nryi|brev|olbe|whfs|kpro|lkcg|vvlp|pjlf|igvl|mnyp|shco|nite|exji|drai|gdgd|cylw|hlgr|qfya|dqle|xhgn|jkbl|cghi|xcow|iwui|ltqm|olmx|rujq|ehop|xpgr|zjfg|zebn|iezt|gazx|cgft|tefk|jijz|smhj|zbwr|vxsd|wjmp|sjbk|hyzm|sszr|iqbq|marj|pdsn|derh|sjit|udlh|xwaz|aodg|quab|gxka|exhs|pzdo|bpjf|pizm|xtio|tdiz|txxv|jaat|hcwi|ekrz|zpyy|ppnm|yewo|upzi|zfmw|suii|alvm|zklz|xesg|nyqk|lvih|eppa|mbdk|soju|hnkt|ifsd|wnzk|pndo|ydrj|bzfs|madj|jhcz|ygnw|zrdu|qskm|lbux|qtdt|xjyy|zkfd|yzhd|dwgn|jdun|kteh|geke|warj|qucv|lvqs|jdda|vrfb|qzjj|rvuo|kzfr|jlka|svhy|dctk|lkss|viju|dqpq|dgxw|mcwy|rtxw|ptsj|bebg|kduq|iivb|zygi|hwql|sgia|hvmj|msxx|woxb|vvsc|zplz|brpf|iyyq|vdvp|dxre|mtky|csjv|yfdl|podp|svrn|eovx|nzax|uplb|neiv|yzdk|mtgq|qrzx|kkhl|rxgm|brqr|fqsv|wcpe|acyf|oqeo|utci|susu|ttha|qnnx|utwc|eoih|bema|abjh|ijyx|tihy|gyll|bkae|kett|mbtk|fuyr|fokr|cazl|exro|azla|cyzv|bnfx|mnxi|qlak|jlai|tcor|fcpy|hudz|zosz|tgzl|zqli|rody|xrvj|ntit|keji|xixi|wbmd|lajm|rlps|klqj|woth|fhmk|psxp|npaz|naph|ahfz|pdkb|fnga|tisy|kijq|drqj|fyym|nfej|vaqa|hnrk|lkeh|wbrh|rmie|iuab|lbxz|mvto|qkqo|wfbk|zawj|sfnb|dagk|vxts|pfnn|eatb|ozor|pkje|slxb|fmpv|yqil|owry|ducb|dywa|xguz|ybrj|eoff|lhfp|qwqk|pada|oele|szmo|lvdw|rsjh|ygid|mtrh|zycp|pfoe|icpz|vxkd|rsdm|isrf|nhsh|mbzq|rukh|usrj|cwno|nxph|utro|xghu|ynvw|wswr|vngd|ahpw|uimq|tirj|ysbv|aetj|wwsx|jxcu|fxvw|mszs|pcuo|tvjf|tsef|setx|zrnr|vcmk|pthb|vqpl|tzfa|lqpu|jqbg|flru|jdrb|agfb|qajb|gopo|dfen|vfnp|myvp|fptx|qvbv|qiii|uuaw|khnh|ujnj|mlds|wicf|ihwv|wumi|smhd|pfda|tltj|ixdo|xvor|zuid|hgst|xfqf|yuuy|qesp|ulke|rqoc|yyae|ejbr|lrob|xwrw|fgcc|phmn|jeib|btmn|sxbn|znio|qxhe|trto|tzty|ohqn|qaej|pgdk|oqvy|dnqb|lfmh|guom|pumx|hxnl|jxxm|pipj|hxjw|jlvu|mbql|hvnh|dzii|xpyx|fjtx|gxjd|ixuy|evpb|ogjp|wqxi|bogv|laoo|bslx|axtq|uwca|qzmp|gojb|kctw|nzlj|fuyw|klzo|nvpg|vhfx|vnmj|jrtx|yuin|lwbr|bpsh|txok|gvrp|acfz|tjga|kgew|rmrh|wszy|fulz|otgd|gnyh|fvsk|roox|xixy|nwqu|rdne|rngx|tyjq|gbrj|kgtn|zoys|pten|sptz|oxkh|kbin|uvwr|cgqw|smec|pvoe|hmdw|nkxs|bzzp|dkzu|txzu|ktrm|bbgp|esgh|ocza|mnoy|ejfc|xfwb|rwkz|mrbl|apwe|wmdr|ojgb|pfvi|napt|mwmb|wukl|rfzs|injw|jmpw|pmxe|pncm|smtx|xgee|oqhe|cqry|sipu|vaew|fuzw|ymkc|vvnr|lrip|nbsn|kjdn|nfdd|amcg|cncw|gmiw|juzo" $wlist = StringSplit($z, "|", 3) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### _AD_OPEN() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _AD_CLOSE() Exit Case $Button1 generate() Case $Button2 setpw() EndSwitch WEnd Func GenSymbol() $symnum = Random(1, 7, 1) If $symnum = 1 Then Global $symbb = "!" If $symnum = 2 Then Global $symbb = "@" If $symnum = 3 Then Global $symbb = "$" If $symnum = 4 Then Global $symbb = ";" If $symnum = 5 Then Global $symbb = "?" If $symnum = 6 Then Global $symbb = "%" If $symnum = 7 Then Global $symbb = "#" EndFunc ;==>GenSymbol Func generate() Global $rnd = Random(1000, 9999, 1) Global $result = "" GUICtrlSetData($Input3, $result) Global $line = $wlist[Random(1, UBound($wlist))] GenSymbol() nato1() $line = $symbb & $line & $rnd GUICtrlSetData($Input3, $line) $rnd2 = StringSplit($rnd, "") EndFunc ;==>generate Func nato1() $myword = $line symbol($symbb) $array = StringSplit($myword, "", 1) For $i = 1 To UBound($array) - 1 $z = nato2($array[$i]) $result = $result & $nato & " " Next $nums = StringSplit($rnd, "", 1) For $i = 1 To UBound($nums) - 1 $y = digit($nums[$i]) $result2 = $result2 & $numb & " " Next $result = $symb & " " & $result & $result2 GUICtrlSetData($Label7, $result) ;GUICtrlSetData($Label8, "") $result = "" $result2 = "" EndFunc ;==>nato1 Func setpw() If Not GUICtrlRead($Input3) Then MsgBox(0, "Error", "You must generate a password first.") Else MsgBox(0, "Complete", "Password has been set. Thank you.") EndIf EndFunc ;==>setpw Func nato2($letter) If $letter = "a" Then Global $nato = "Alpha" If $letter = "b" Then Global $nato = "Bravo" If $letter = "c" Then Global $nato = "Charlie" If $letter = "d" Then Global $nato = "Delta" If $letter = "e" Then Global $nato = "Echo" If $letter = "f" Then Global $nato = "Foxtrot" If $letter = "g" Then Global $nato = "Golf" If $letter = "h" Then Global $nato = "Hotel" If $letter = "i" Then Global $nato = "India" If $letter = "j" Then Global $nato = "Juliet" If $letter = "k" Then Global $nato = "Kilo" If $letter = "l" Then Global $nato = "Lima" If $letter = "m" Then Global $nato = "Mike" If $letter = "n" Then Global $nato = "November" If $letter = "o" Then Global $nato = "Oscar" If $letter = "p" Then Global $nato = "Papa" If $letter = "q" Then Global $nato = "Quebec" If $letter = "r" Then Global $nato = "Romeo" If $letter = "s" Then Global $nato = "Sierra" If $letter = "t" Then Global $nato = "Tango" If $letter = "u" Then Global $nato = "Uniform" If $letter = "v" Then Global $nato = "Victor" If $letter = "w" Then Global $nato = "Whiskey" If $letter = "x" Then Global $nato = "X-ray" If $letter = "y" Then Global $nato = "Yankee" If $letter = "z" Then Global $nato = "Zulu" Return EndFunc ;==>nato2 Func symbol($sym) If $sym = "!" Then Global $symb = "Exclamation-Mark" If $sym = "@" Then Global $symb = "At-Sign" If $sym = "$" Then Global $symb = "Dollar-Sign" If $sym = ";" Then Global $symb = "Semi-Colon" If $sym = "?" Then Global $symb = "Question-Mark" If $sym = "%" Then Global $symb = "Percent-Sign" If $sym = "#" Then Global $symb = "Pound-Sign" Return EndFunc ;==>symbol Func digit($num) If $num = "1" Then Global $numb = "One" If $num = "2" Then Global $numb = "Two" If $num = "3" Then Global $numb = "Three" If $num = "4" Then Global $numb = "Four" If $num = "5" Then Global $numb = "Five" If $num = "6" Then Global $numb = "Six" If $num = "7" Then Global $numb = "Seven" If $num = "8" Then Global $numb = "Eight" If $num = "9" Then Global $numb = "Nine" If $num = "0" Then Global $numb = "Zero" Return EndFunc ;==>digit Feel free to update and make it better.
  15. So I've been looking everywhere for an answer to this but I haven't managed to get anything to work. Below is the basic function to set a proxy for IE through the registry. Many say that I can simply write a proxy in the format "user:pass@server:port" to ProxyServer but that hasn't worked for me. I have also tried other suggestions such as creating a ProxyUser / ProxyPass key and writing credentials to those keys but still no dice. Func _IESetProxy($tProxy) If $tProxy="0" Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 0) Else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", $tProxy) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 1) EndIf EndFunc I believe this article from Microsoft may have something to do with it? So I tried this (with 0 and 1 values): RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE") RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE", "iexplore.exe", "REG_DWORD", 0) RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE", "explorer.exe", "REG_DWORD", 0) and still no luck! Please! I desperately need help for this! Thanks a million in advance!
  16. This script is used to create and display Latin Squares and to use them to create a secure password. You would use this to create a password, as an example, by inputting the name of the site you need the password for and pressing the GeneratePW button. The resulting password will be displayed in the red box to the right of the input. The password generator uses up to 6 characters of whatever is typed into the input (n) to create a password whose length is n*2. So, for example, if you were to go to and you needed a password for it, you would type in autoitscript and generate the password. Because the password generator only uses the first 6 characters, autoit in this case, it would output a 12 character password for you. Each Latin Square you generate can be used to create 26 different passwords for the same 6 character string by selecting a different starting row for each. Each square can also generate several hundred different passwords for the same character string by selecting a different number of characters to use and a different starting row for each of those. If you also throw in that you can add either a random punctuation character or a random 1 digit number, or both, the combinations for just one square are probably a lot more than you could ever need in a lifetime even if you had to change a password every week. Plus, you can use this script to generate new squares whenever you'd like. Each time you generate a new Latin Square the square is saved to a text file called *.pwf, the filename is determined by generating the password for Autoit using that square and the first row as the starting row. When you generate a new latin square, there is no control over it's generation, it's random as to what letters are placed where with no row or column having more than one instance of every letter. When you choose the case of the letters, by using the combobox, the mixed mode will always change the case of the letters to be the same every time. I originally had it so that the case was chosen randomly, but that made it virtually impossible to retrieve a password that was previously created. The way this password generator works is by finding the first letter, of the string you typed in, in the starting row you've selected. It will then search the column that that letter was found in to find the second letter, then searches the row that letter was found in, and so on until it reaches the end of your string or the number of characters you've selected in the combo box. Once it has found the last letter in the search, it repeats the search using the position of that last found letter, and searches either the row or column that the letter is found in. It chooses the search direction based upon the last direction it searched in to find that last character. If it searched a row to find it, it will search the column to find the first letter in your string the second round. Depending upon the direction of the search from the last character of your string to the first character of your string (L->R/R->L/Up/Down) the 2 characters immediately adjacent to the character, and in the direction searched, are chosen for the password string. Alternating between the rows and columns it will continue adding 2 characters for every character in your string. Searching for the string "autoit" in the square below gives you the resulting password of "XMRUQMOUHPKV" when starting the search from the first row. There is an option to select the case of the letters used to generate the password, the default is a mix of upper and lower case letters, there is also a setting for all lower and all upper case letters as well. The picture below shows how the password is found, the red line is the initial search, and the green line is the password generating search. The purple circles show where the letters are that are used to create the password. The case of the letters in the input string doesn’t matter as the searches aren't case sensitive. After the password is generated and you see it in the red square, it is also copied to the clipboard so that you can paste it into whatever you're working with that needed that password. There is a checkbox that allows you to add a random punctuation character and/or a number to the password generated for any sites that require it. There are also checkboxes to save, and retrieve saved, passwords. The passwords are saved to a file called "Lsquare.dll", I used this file name only because it helps obscure your password list a tiny bit. This file is automatically encrypted and decrypted using AES 256 encryption whenever it's needed for added security from prying eyes. The file Lsquare.dll is actually an INI file the format of the ini file information is as follows: section name = input string key = File name of the pwf file, a space then the starting row # another space and then case used ("M" for mixed, "L" for all lower, "U" for all upper), another space and any punctuation and/or numerical characters added value = the checkbox indicator for what extra characters were added: "+" = both boxes checked, "S" = punctuation box checked, "N" = number box checked, "0" = no boxes checked The actual password is never put into the ini file, just the way it was generated, for protection. Plus the ini file is encrypted for even more protection from prying eyes. If you don't have the pwf file used to generate the password none of this information is going to get the password. So, even if you hack the program and get the keys used to encrypt the ini file, it's useless without the correct pwf file. The "Load" button will allow you to load another password file, there is a verification process to check that the file being loaded is actually a password file or not. After you have loaded a new password file, if you close the program, the next time you reopen it, the last selected pwf will be reloaded, otherwise the last pwf generated will be loaded. If you are running the program for the first time, a new password file will be created and loaded into the listview. You will need to download Melba23's to use this. I used it to show/hide the square if you wanted to. If you would rather not download that, you can comment out or delete all lines that contain any functions that reference _GUIExtender_. The script will work without using the UDF, but you lose the ability to hide the listview. This script is heavily commented so that if you're wondering how it all works it should be in there. Also take note that the time needed to generate a new square varies widely, anywhere from a few seconds to over several minutes. The process can get quite complicated as it generates the lines further into the square, and you may see it pausing for a while at some of the lines in the 20's. I put some consolewrite code in that let me follow the progress of the process, and also tells me how many times the line had to be reset before it could come up with a valid line. I've seen the number of attempts at over 3,000 in some cases for just one line. This script will generate any number of reasonably secure passwords, but it's only as secure as the computer you're using it on and whether or not anyone can access the script, the INI file, and the Latin square file used to generate the password. If you lose the *.pwf file used you won't be able to retrieve the password. If you lose access to the ini file, but still have the *.pwf files, you may be able to recreate the password but it will be very tough to do so because of the numerous factors that determine how the password is generated. As always, if there are any bugs, or you're not sure how something works, or a modification is politely asked for, please feel free to leave a comment. You can create a password using more than 6 characters of your passphrase by looking at the comments at lines 560 and 561, just remember, the password generated is twice as many characters as the passphrase used. LatinSquare.au3 download link EDIT:Changed download link
  17. Hello Auto IT I wanna keep it short, so let's get started. I like to store my account details for various sites and programs on a simple log file, It's personal preference and I know it's risky. I'm using somewhat a "form" when I'm typing in my accounts, so that It's easier for me to keep track on what site/program the account is for. The form looks somewhat like this: Would it be possible to create a script in which makes a UI where i can type in those fields, and it will automaticly add it to my log file? I would love to know how this could work, and what kind commands i should look into. - AliOzturk
  18. Hi, someone is so gentle to show me the Best - Secure way to store locally a passwords saved from a basic InpuBox()? I have read to don't store the password in the compiled script but put the password crypted in a file, but not in as plain text can be easyly opened Thanks to all
  19. Hello I need to open with autoit a MS access database! This database is opening with this shortcut: "C:\Program Files (x86)\Microsoft Office\OFFICE11\MSACCESS.EXE" /wrkgrp \\server\folder\sys.mdw \\server\folder\database.mdb /user MyUser /pwd MyPass How do I open this in Autoit. (using COM object) $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & $dbname&"; SystemDB="&$wkname&"; " , $user, $pwd) If Not(IsObj($adoCon)) Then MsgBox(0,"error","error") Exit EndIf ; create recordset $adoRs = ObjCreate("ADODB.Recordset") $adoRs.CursorType = 1 $adoRs.LockType = 3 $sQuery = 'SELECT * FROM Address;' ; open query $adoRs.Open($sQuery, $adoCon) ... I got an error with the Query ! Need help Thanks in advance ! Cramaboule
  20. Is there anyway that AutoIT is able to pull the Windows username and password from the computer in use. This is for a program I am going to try and create that will unlock the computer when their information is entered into the appropriate fields. Any answers are much appreciated!
  21. Ever wanted to use Autoit to lock up your flash drive at home? Well here's the code for it. Code from user LvlUp and some minor modification from me. All props to LvlUp and his coding abilities and assistance with this code. Here's the main code: #NoTrayIcon #include <Misc.au3> #include <eject.au3> Opt("TrayMenuMode",1) $menu = TrayCreateItem("DriveLocker") $menu2 = TrayCreateItem("") $menuLock = TrayCreateItem("Lock Drive") $menuExit = TrayCreateItem("Exit") TraySetState() While 1 $letter = DriveGetDrive("REMOVABLE") If IsArray($letter) Then For $i = 1 to $letter[0] _Check($letter[$i]) Next EndIf $time = TimerInit() While TimerDiff($time) < 10000 $msg = TrayGetMsg() TrayItemSetState($msg,4) Select Case $msg = $menuLock _LockDrive() Case $msg = $menuExit Exit EndSelect Sleep(100) WEnd WEnd Func _Check($strDriveLetter) If FileExists($strDriveLetter & "\IAmLocked") Then _Unlock($strDriveLetter) EndFunc Func _Unlock($strDriveLetter) $strPassword = InputBox("Security Check", "Enter your password.", "", "*", "", "", @DesktopWidth/2, @DesktopHeight/2,15, "passwordBox") ToolTip("Enter Password NOW.") _MouseTrap(@DesktopWidth, @DesktopHeight-100) If ($strPassword = "password") Then _MouseTrap() FileDelete($strDriveLetter & "\IAmLocked") _ReAnimate($strDriveLetter) Else EjectVolume($strDriveLetter) _MouseTrap() EndIf EndFunc Func _ReAnimate($strDriveLetter) ;Closes the autoplay window if open WinClose("AutoPlay") EndFunc Func _LockDrive() $letter = DriveGetDrive("REMOVABLE") If IsArray($letter) Then For $i = 1 To $letter[0] If MsgBox(36,"Lock This Drive?","Do you wish to lock the " & StringUpper($letter[$i]) & " drive?") = 6 Then FileWrite($letter[$i] & "\IAmLocked","Locked") EjectVolume($letter[$i]) EndIf Next EndIf EndFunc And the includes file for eject.au3 #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinApi.au3> ;Prototypes ;BOOL EjectVolume(TCHAR cDriveLetter); ;HANDLE OpenVolume(TCHAR cDriveLetter); ;BOOL LockVolume(HANDLE hVolume); ;BOOL DismountVolume(HANDLE hVolume); ;BOOL PreventRemovalOfVolume(HANDLE hVolume, BOOL fPrevent); ;BOOL AutoEjectVolume(HANDLE hVolume); ;BOOL CloseVolume(HANDLE hVolume); ;StringFormat Output $szVolumeFormat = "\\\\.\\%s" $szRootFormat = "%s\\" $szErrorFormat = "Error %d: %s\n" ;------------------------------------------ ;Arbitrary variables ;;Global Const $INVALID_HANDLE_VALUE = 0 ;------------------------------------------ ;DeviceIoControl Contants Global Const $FSCTL_LOCK_VOLUME = int(0x090018) Global Const $FSCTL_DISMOUNT_VOLUME = int(0x00090020) Global Const $IOCTL_STORAGE_EJECT_MEDIA = int(0x002D4808) Global Const $IOCTL_STORAGE_MEDIA_REMOVAL = int(0x002D4804) ;------------------------------------------ ;Retry Constants Global Const $LOCK_TIMEOUT = 10000 ; 10 Seconds Global Const $LOCK_RETRIES = 20 ;$OpenVolume = InputBox("Ejecting...", "Enter the drive to eject", "G:") ;ConsoleWrite("Trying to Eject the drive " & EjectVolume($OpenVolume) & @crlf) Func ReportError($szMsg) ConsoleWrite(StringFormat($szErrorFormat, _WinAPI_GetLastErrorMessage (), $szMsg) & @CRLF) Exit EndFunc ;==>ReportError Func OpenVolume($cDriveLetter) ;HANDLE hVolume ;UINT uDriveType ;TCHAR szVolumeName[8] ;TCHAR szRootName[5] ;DWORD dwAccessFlags $szRootName = StringFormat($szRootFormat, $cDriveLetter) $uDriveType = DriveGetType($szRootName); ConsoleWrite($szRootName & @tab & $uDriveType & @crlf) Switch $uDriveType Case "Removable" $dwAccessFlags = 6 Case "CDROM" $dwAccessFlags = 2 Case Else ConsoleWrite("Cannot eject. Drive type is incorrect." & @CRLF) Return $INVALID_HANDLE_VALUE EndSwitch $szVolumeName = StringFormat($szVolumeFormat, $cDriveLetter) ;$szVolumeName = $szVolumeFormat & $cDriveLetter ConsoleWrite($szVolumeName & @crlf ) $hVolume = _WinAPI_CreateFile ($szVolumeName, 2,$dwAccessFlags, 6) #cs hVolume = CreateFile( szVolumeName, dwAccessFlags, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); #ce If ($hVolume == $INVALID_HANDLE_VALUE) Then ReportError("CreateFile"); Return $hVolume; EndFunc ;==>OpenVolume Func CloseVolume($hVolume) Return _WinAPI_CloseHandle ($hVolume); EndFunc ;==>CloseVolume Func LockVolume($hVolume) Local $dwBytesReturned Local $dwSleepAmount Local $nTryCount local $iRead $dwSleepAmount = $LOCK_TIMEOUT / $LOCK_RETRIES; ; Do this in a loop until a timeout period has expired For $nTryCount = 0 To $nTryCount < $LOCK_RETRIES If _Device_Control($hVolume, $FSCTL_LOCK_VOLUME, $iRead) Then Return True Else Sleep($dwSleepAmount); EndIf Next Return False; EndFunc ;==>LockVolume Func DismountVolume($hVolume) ConsoleWrite("Dismount " & $hVolume & @crlf) Local $dwBytesReturned, $iRead local $aResult = _Device_Control($hVolume, $FSCTL_DISMOUNT_VOLUME, $iRead) ;msgbox(0,"",$aResult) Return $aResult ;Return $dwBytesReturned EndFunc ;==>DismountVolume Func PreventRemovalOfVolume($hVolume, $fPreventRemoval) Local $dwBytesReturned Local $aResult Local $lpInbuffer,$nInBufferSize,$lpOutBuffer,$nOutBufferSize,$lpOverlapped $PMRBUFFER = DllStructCreate("bool PreventMediaRemoval") DllStructSetData($PMRBUFFER,"PreventMediaRemoval",$fPreventRemoval) $lpBytesReturned = DllStructCreate("int Read") $pRead = DllStructGetPtr($lpBytesReturned, "Read") $aResult = Dllcall("kernel32.dll","int","DeviceIoControl","hwnd",$hVolume,"uint",$IOCTL_STORAGE_MEDIA_REMOVAL,"ptr",DllStructGetPtr($PMRBUFFER),"uint",DllStructGetSize($PMRBUFFER), _ "ptr",$lpOutBuffer,"uint",$nOutBufferSize,"ptr",$pRead,"ptr",$lpOverlapped) if $aResult = 0 then msgbox(0,"",_WinAPI_GetLastErrorMessage()) Return $aResult <> 0 ;& PMRBuffer, sizeof (PREVENT_MEDIA_REMOVAL), ;NULL, 0, ; & dwBytesReturned, ;NULL); EndFunc ;==>PreventRemovalOfVolume Func AutoEjectVolume($hVolume) Local $aResult, $iRead; $aResult = _Device_Control($hVolume, $IOCTL_STORAGE_EJECT_MEDIA, $iRead) Return $aResult EndFunc ;==>AutoEjectVolume Func EjectVolume($cDriveLetter) Local $hVolume; Local $fRemoveSafely = False; Local $fAutoEject = False; ; Open the volume. $hVolume = OpenVolume($cDriveLetter); If $hVolume == $INVALID_HANDLE_VALUE Then Return False ; Lock and dismount the volume. If LockVolume($hVolume) And DismountVolume($hVolume) Then $fRemoveSafely = True; ConsoleWrite("Volume Locked and Dismounted, trying to Eject " & @crlf) ; Set prevent removal to false and Eject the volume. If PreventRemovalOfVolume($hVolume, False) And AutoEjectVolume($hVolume) Then $fAutoEject = True; EndIf Else ConsoleWrite("Volume can't be locked or dismounted, please close possible opened files" & @crlf) EndIf ; Close the volume so other processes can use the drive. If CloseVolume($hVolume) = False Then Return False; EndIf If $fAutoEject Then ConsoleWrite(StringFormat("Media in drive %s has been ejected safely.\n", $cDriveLetter)) Else If $fRemoveSafely Then ConsoleWrite(StringFormat("Media in drive %s can be safely removed.\n", $cDriveLetter)) EndIf EndIf Return True; EndFunc ;==>EjectVolume Func _Device_Control($hDevice, $dwIoControlAutoit, ByRef $iRead) Local $aResult Local $lpInbuffer,$nInBufferSize,$lpOutBuffer,$nOutBufferSize,$lpOverlapped $tRead = DllStructCreate("int Data") $aResult = Dllcall("kernel32.dll","int","DeviceIoControl","hwnd",$hDevice,"uint",$dwIoControlAutoit,"ptr",$lpInBuffer,"uint",0, _ "ptr",$lpOutBuffer,"uint",0,"ptr",DllStructGetPtr($tRead),"ptr",$lpOverlapped) $iRead = DllStructGetData($tRead, "Data") ConsoleWrite("Device Control " & $iRead & @CRLF) Return $aResult<>0 EndFunc ;==>_Device_Control Enjoy.
  22. Hi I want to start writing a script to automate some tasks in Microsoft Active directory. Basically, I want to be able to connect to an already open AD window, get the user list, double click on each user name, click on reset password and set new password. Can some one help me with a basic script that could become a starting point for the same ? I tried using AutoInfo on AD window, but not able to get class names etc. for the list, buttons etc.
  23. First example script. Yay for me! So apologies if there is a certain way i need to do this. It is probably more accurate to state that this is code from different people put into a instantly usable script. First, credits go to: For the encrypt\decrypt code: For the Verification against AD code: I have added commentary in the scripts that will hopefully help the newbie factor out a bit. I've been there and its nice to have helpful comments. In case you need to compare your situation with mine: I work on a helpdesk. I log on with a standard signon and use a different signon for administrative tasks. I am using this to run other scripts as an administrator.In "CredCheck.au3", it will check the username and password given against Active Directory. If it fails, it will let you know. If it succeeds, it will run the given program or script as administrator. It also writes the password to an ini file and encrypts it, and also writes the username - unencrypted. In "Unencrypt Test.au3" it will unencrypt the password which will allow it to be injected into password fields of remote pc's if needed. In my case, I did need this. CredCheck.au3 unencrypt test.au3 Good luck and any criticism welcome!
  24. So I have tested a bit of code that allows me to store login and password information and use it later on to login. See Code below Func LoginInfo() Local $User, $Password Local $btn, $msg Global $Usr, $Pwd GUICreate(" User Name and Password for ESQ", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1) $User = GUICtrlCreateInput("", 10, 5, 300, 20) $Password = GUICtrlCreateInput("", 10, 35, 300, 20,0x0020) $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn ExitLoop EndSelect WEnd $Usr = GUICtrlRead($User) $Pwd = GUICtrlRead($Password) ;MsgBox(4096, "User and Password", GUICtrlRead($User)) ;MsgBox(0,"Password",GUICtrlRead($Password)) EndFunc LoginInfo() #include <IE.au3> MsgBox(4096, "User and Password", $Usr) MsgBox(0,"Password",$Pwd) $URL = "" $IE = _IECreate($URL, 0, 0, 0) $HWND = _IEPropertyGet($IE, "hwnd") WinSetState($HWND,"",@SW_MAXIMIZE) _IEAction($IE, "visible") _IELoadWait($IE) Sleep(1000) Sleep(1000) MouseClick("Left",-685,274) Send($Usr) Sleep(1000) MouseClick("Left",-685,296) Send($Pwd) Sleep(500) Send(@CR) Once I use this working code in my larger program it fails. It won't store the login and password information, nor will it wait for rest of the program until the login information is entered. What am I doing wrong?