
hiimjoey11
Active Members-
Posts
62 -
Joined
-
Last visited
Everything posted by hiimjoey11
-
-
Using a program that is installed on all our computers to spread the program and execute it. I will see if this has the ability to run command line operations and just do it that way if there is no autoIt friendly way! Thanks!
-
I would have to encrypt it outside of AutoIt... as soon as i did your method, i could still use a decompiler and pull the password directly from that script.
-
so this will encrypt it? Did i do this right? #include <MsgBoxConstants.au3> Example() Func Example() Local Const $sUserKey = "WontTheyKnowThisPasswordThen?" ; Declare a password string to decrypt/encrypt the data. Local $sData = "AdminPassword." ; Data that will be encrypted Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_RC4) ; Encrypt the data using the generic password string. $bEncrypted = _Crypt_DecryptData($bEncrypted, $sUserKey, $CALG_RC4) ; Decrypt the data using the generic password string. The return value is a binary string. RunWait(@ComSpec & ' /c net user Administrator ' & BinaryToString($bEncrypted)) ; Convert the binary string using BinaryToString to display the initial data we encrypted. EndFunc ;==>Example
-
But then someone can decompile the script before it's run, right?
-
I am trying to create a quick script to change the administrator password on all our PCs, but I need to embed the password in the script. Is there a way to do this securely? I dont want the password in plain text, and i dont want someone to be able to decompile the script and be able to get the password. I plan on changing the password with the code below RunWait(@ComSpec & ' /c net user Administrator passwordHere') Thanks!
-
For anyone having this problem, it was my antivirus blocking it in this case
-
I know, i know this has been asked a million times, but i can't seem to get this to work I'm using Jos' code and double checked my username/password and i am still getting the "Error code:2 Description:The transport failed to connect to the server." Any suggestions? ; ;################################## ; Include ;################################## #Include<file.au3> ;################################## ; Variables ;################################## $SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED $FromName = "Name" ; name from who the email was sent $FromAddress = "your@Email.Address.com" ; address from where the mail should come $ToAddress = "myemailwashere@gmail.com" ; destination address of the email - REQUIRED $Subject = "Userinfo" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "myemailwashere@gmail.com" ; username for the account used from where the mail gets sent - REQUIRED $Password = InputBox("password", "pw", "", "*") $IPPort = 465 ; port used for sending the mail $ssl = 1 ; enables/disables secure socket layer sending - put to 1 if using httpS ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0) Local $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) ;~ ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail="" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1); something to check for when this function returns Return EndFunc ;==>MyErrFunc
-
Reverse it where exactly But yes, this does help tremendously! Thanks for your time
-
Works well except i think it's backwards! If you type in 1 (enter), 2 (enter), 3 (enter) and press the UP button it should show your last entry which is 3.. instead it shows your first entry. Also, I just saw there is an _ArrayPop and _ArrayPush, i kind of got it working using them, but it's not right. Any suggestions on this method? #include <GUIConstants.au3> #include <Array.au3> GUICreate("test", 200, 400) $input = GUICtrlCreateInput("", 10, 10, 150, 20, $ES_CENTER) GUICtrlSetLimit(-1, 4) $input2 = GUICtrlCreateInput("", 10, 50, 150, 300, $ES_MULTILINE) GUISetState() ;HotKeySet("{DOWN}", "_HistoryDown") ;HotKeySet("{UP}", "_HistoryUp") $HistDown = GUICtrlCreateDummy() $HistUp = GUICtrlCreateDummy() $Enter = GUICtrlCreateDummy() Local $aAccelKeys[3][3] = [["{DOWN}", $HistDown], ["{UP}", $HistUp], ["{ENTER}", $Enter]] GUISetAccelerators($aAccelKeys) $arrayCount = 1 Dim $historyArray = [] While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $HistDown GUICtrlSetData($input, "") Enter() Case $HistUp $pop = _ArrayPop($historyArray) GUICtrlSetData($input, $pop) ;_ArrayPush($historyArray, $pop, 1) Case $Enter Enter() EndSwitch WEnd Func Enter() If Not GUICtrlRead($input) = "" Then _ArrayInsert($historyArray, UBound($historyArray) - 1, GUICtrlRead($input)) GUICtrlSetData($input2, _ArrayToString($historyArray, @CRLF)) EndIf EndFunc ;==>Enter
-
I think im getting closer... what am i doing wrong here.. #include <GUIConstants.au3> #include <Array.au3> GUICreate("test", 200, 200) $input = GUICtrlCreateInput("", 10, 10, 150, 20, $ES_CENTER) GUICtrlSetLimit(-1, 4) $input2 = GUICtrlCreateInput("", 10, 50, 150, 100, $ES_MULTILINE) GUISetState() ;HotKeySet("{DOWN}", "_HistoryDown") ;HotKeySet("{UP}", "_HistoryUp") $HistDown = GUICtrlCreateDummy() $HistUp = GUICtrlCreateDummy() $Enter = GUICtrlCreateDummy() Local $aAccelKeys[3][3] = [["{DOWN}", $HistDown], ["{UP}", $HistUp], ["{ENTER}", $Enter]] GUISetAccelerators($aAccelKeys) $arrayCount = 1 Dim $historyArray = [] While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $HistDown If $arrayCount < 0 Then $arrayCount -= 1 GUICtrlSetData($input, $historyArray[$arrayCount]) Enter() Else GUICtrlSetData($input, "") EndIf Case $HistUp $arrayCount += 1 GUICtrlSetData($input, $historyArray[$arrayCount]) Enter() Case $Enter Enter() EndSwitch WEnd Func Enter() _ArrayAdd($historyArray, GUICtrlRead($input)) GUICtrlSetData($input2, GUICtrlRead($input2) & @CRLF & GUICtrlRead($input)) EndFunc ;==>Enter
-
I am trying to make a "command prompt" type input box. What i mean by this, is when you press the "UP" arrow it will go up in your previously entered history, and "DOWN" will go back down through the history just like command prompt does. Any suggestions on how to go about this? This is what i have gotten so far, but not sure if HotKeys are the way to go. Any input is greatly appreciated! Thanks! #include <GUIConstants.au3> GUICreate("test", 200, 100) $input = GUICtrlCreateInput("", 10, 10, 150, 20, $ES_CENTER) GUICtrlSetLimit(-1, 4) $input2 = GUICtrlCreateInput("", 10, 50, 150) GUISetState() HotKeySet("{DOWN}", "_HistoryDown") HotKeySet("{UP}", "_HistoryUp") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch If StringLen(GUICtrlRead($input)) = 4 Then Enter() EndIf WEnd Func Enter() GUICtrlSetData($input2, "This is the current input: " & GUICtrlRead($input)) EndFunc Func _HistoryUp() GUICtrlSetData($input, "go up in history") EndFunc Func _HistoryDown() GUICtrlSetData($input, "go down in history") EndFunc
-
Return value from MsgBox
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
No problem! Thanks for trying.. If you get bored in the next few days and decide to look at it let me know Ill keep an eye on this forum for a few days. EDIT: I got it! I finally read the help file for command line, and to get your line of code to work with compiled scripts you need to include this line! Thanks for pointing me in the right direction! Works flawless now. #pragma compile(AutoItExecuteAllowed, True) _MoveMsgBox(0, "Test", "testing") Func _MoveMsgBox($Flag, $Title, $Text, $Time=0, $bReturnVal = True) Local $iPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine "Exit MsgBox(' & $Flag & ', ''' & $Title & ''', ''' & $Text & ''',' & $Time & ')"') If Not $bReturnVal Then Return $iPID Local $iAccess = ((_WinAPI_GetVersion() >= 6.0) ? _ $PROCESS_QUERY_LIMITED_INFORMATION : $PROCESS_QUERY_INFORMATION) Local $hProcess = _WinAPI_OpenProcess($PROCESS_QUERY_LIMITED_INFORMATION, 0, $iPID) If @error Or Not $hProcess Then Return $iPID While ProcessExists($iPID) Sleep(10) WEnd Local $iRet = Int(_WinAPI_GetExitCodeProcess($hProcess)) _WinAPI_CloseHandle($hProcess) Return $iRet EndFunc -
Return value from MsgBox
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
haha but it works perfectly if you just run it -
Return value from MsgBox
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
v3.3.8.1 EDIT: Updated and yours worked like a charm Thank you EDIT2: Only worked if i run it, not if a build it... hmm -
Return value from MsgBox
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
I'll have to try it if there isn't a simpler solution, thank you! -
Return value from MsgBox
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
Johnmcloud, anyway to do this without writing to files? -
Return value from MsgBox
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
Func _MoveMsgBox($Flag, $Title, $Text, $Time=0) $value = RunWait(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(' & $Flag & ', ''' & $Title & ''', ''' & $Text & ''',' & $Time & ')"') MsgBox(0, "", $value) Return $value EndFunc This returns 0 for them all :/ -
Return value from MsgBox
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
Thanks for this! But it doesn't work.. "Error: can't open include file <WinAPIPRoc.au3> and same with <WinAPISys.au3>. Is that part needed? What exactly does this do? -
I am trying to use MrCreatoR's _MoveMsgBox from the bottom of this topic: '?do=embed' frameborder='0' data-embedContent>> But I also need it to return the value of that MsgBox. Is this possible? So instead of his original: Func _MoveMsgBox($Flag, $Title, $Text, $Time=0) Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(' & $Flag & ', ''' & $Title & ''', ''' & $Text & ''',' & $Time & ')"') EndFunc I would need something like this (which doesnt work): Func _MoveMsgBox($Flag, $Title, $Text, $Time=0) Return Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(' & $Flag & ', ''' & $Title & ''', ''' & $Text & ''',' & $Time & ')"') EndFunc Any suggestions?
-
I am trying to create an autoit script that checks if a user accidentally types in their password into somewhere they shouldn't (like a chat window). So basically, if this window is active, and this word is typed, ask the user if they are sure they want to send this password. This code i slightly modified from here works, but is VERY buggy, and I can't seem to get it to work very well: '?do=embed' frameborder='0' data-embedContent>> It prompts if the user wants to send it, but doesn't work if i hit "YES." Any help is greatly appreciated! HotKeySet("{ESC}","gone");allow us to quit Global $code = "mypassword";the code to detect Global $arrayc = StringSplit($code, "") Global $progress = 0;how many keys in sequence detected For $n = 1 To $arrayc[0] HotKeySet($arrayc[$n], "hcoder") Next ;add some keys that are not in the code but chosen so it is unlikely ;that the keys will occur in sequence without one of these being pressed HotKeySet("{ENTER}","hcoder") ;add more if needed. While 1;hang around while waiting for keys Sleep(20) WEnd Func hcoder() HotKeySet(@HotKeyPressed) Send(@HotKeyPressed) If @HotKeyPressed = $arrayc[$progress + 1] Then $progress += 1 ConsoleWrite("count = " & $progress & @LF) Else $progress = 0 EndIf If $progress >= StringLen($code) AND WinActive("Notepad") Then HotKeySet("{ENTER}", "DoNothing") EndIf HotKeySet(@HotKeyPressed, "hcoder") EndFunc ;==>hcoder Func gone() Exit EndFunc ;==>gone Func DoNothing() $answer = MsgBox(4, "", "Are you sure you want to send this password?") If $answer = 6 Then WinActivate("Notepad") Send("{ENTER}") EndIf $progress = 0 EndFunc ;==>DoNothing
-
Disable ESC if certain window is opened
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
Ah! PERFECT. Thank you very much! -
Disable ESC if certain window is opened
hiimjoey11 posted a topic in AutoIt General Help and Support
So currently I have this where it will pop up a message box when i press ESC in that particular window. What it also does it still send the ESC key command. I am trying to make it NOT send ESC if that particular window is active. Here is what i tried so far, but didn't seem to work. Do I need to do a keyboard hook or something? #include <Misc.au3> While 1 If _IsPressed("1B") AND WinActive("MyWindow") Then ;Disable ESC key here MsgBox(0, "", "Esc pressed") EndIf WEnd -
GuiCtrlCreateInput automatically hit Enter
hiimjoey11 replied to hiimjoey11's topic in AutoIt General Help and Support
Works perfect thank you -
I currently have an inputbox that only accepts numbers and only accepts 4 characters. When they are finished typing in those numbers, you hit enter and it will call a function. How can i make it so it automatically calls my function after they type 4 numbers into that box (instead of requiring an ENTER push)? #include <EditConstants.au3> #include <GUIConstantsEx.au3> $Form1_1 = GUICreate("test") $Input1 = GUICtrlCreateInput("", 72, 16, 136, 28, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) GUICtrlSetLimit($Input1, 4, 4) GUISetState(@SW_SHOW) $ButtonDummy = GUICtrlCreateDummy() Dim $EnterArray[1][2] = [["{ENTER}", $ButtonDummy]] GUISetAccelerators($EnterArray) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonDummy Enter() EndSwitch WEnd Func Enter() MsgBox(0,"","Enter pressed") EndFunc