Jump to content

0xdefea7

Active Members
  • Posts

    162
  • Joined

  • Last visited

Recent Profile Visitors

279 profile views

0xdefea7's Achievements

  1. This is untested, but might do what you want without making duplicates: #include <File.au3> $sPath = @HomeDrive & "\daily mai" $aFiles = _FileListToArray($sPath) $sBushObama = "D:\data mail\bush obama" $sLaNy = "D:\data mail\la ny" For $i = 0 To UBound($aFiles) - 1 If StringInStr($aFiles[$i], "Bush Obama") && Not FileExists($sBushObama & "\" & $aFiles[$i]) Then FileCopy($sPath & "\" & $aFiles[i], $sBushObama & "\" & $aFiles[$i]) If StringInStr($aFiles[$i], "la ny") && Not FileExists($sLaNy & "\" & $aFiles[$i]) Then FileCopy($sPath & "\" & $aFiles[i], $sLaNy & "\" & $aFiles[$i]) Next
  2. Try this: Send("{LWIN}{LSHIFT}{LEFT}") RTM first if you need more help, the answer was right here: http://www.autoitscript.com/autoit3/docs/functions/Send.htm
  3. To disable taskmgr globally, do this: RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\", "DisableTaskMgr", "REG_DWORD", 1) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DisableCAD", "REG_DWORD", 1) You need to run as admin. Not exactly true. It can be disable/remapped in Windows. Yes, but this is far from trivial, there are better alternatives.
  4. Window probably still exists when you are trying to close "notepad.exe". The functionality you want will be better utilized like this: OnAutoItExitRegister("Leave") ;Put this at the top of your code Func Leave() If ProcessExists("notepad.exe") Then ProcessClose("notepad.exe") Exit EndFunc EDIT: Or in your main loop using $GUI_EVENT_CLOSE: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE If ProcessExists("notepad.exe") Then ProcessClose("notepad.exe") Exit EndSwitch WEnd
  5. The word "Tit" is slang in English for female breast, which makes this line rather funny (though correct):
  6. User Defined Function Yes, Services.au3 is the UDF. To make things easier for you, you could use the Scite functionality to jump to the function from your script. Simply highlight the entire function name "_Service_Change", and press Ctrl + J
  7. Using FileInstall() allows you to take a file that exists on disk, and use it in your exe later (even on another PC). You use it like this: $sFile = "C:\Test\calc.exe" If Not FileExists($sFile) Then FileInstall("C:\calc.exe", $sFile) Run($sFile) The function above will check to see if a file exists ($sFile) and then place the file on the disk if it does not, then run the file. To make it work, you need to copy "calc.exe" and place in your C: drive. Compile the script, then run it on your PC, and another PC. If it works correctly, it should open the Windows calculator from "C:Testcalc.exe"
  8. You cannot do that. Windows has built in special protection to stop you from being able to automate that window. You have to do as Kidney said if you want to bypass it, or add this at the very top of your script: #RequireAdmin If you add #RequireAdmin, you will see the UAC prompt only when you start your program, anything that you run after it will run with the same privileges, so you will not get that UAC box popping up again.
  9. The code I posted works just fine. If you adjust your code to match, it should work correctly. Would you please post your updated code that you are having trouble with?
  10. I do the same as Melba said, save to variable first, then access the array using the temporary variable. There is no way to do it directly. Dim $AnotherArray[5] = ["zero", "one", "two", "three", "four"] Dim $Array[4] Dim $Temp $Array[0] = 1 $Array[1] = True $Array[2] = "Text" $Array[3] = $AnotherArray ConsoleWrite($Array[3][2]) ; <-- this is obviously wrong $Temp = $Array[3] ;Grab the array and save to $Temp ConsoleWrite($Temp[2] & @CRLF) ;Prints 2 to the console ; is there a way to read "directly" the element [2] of the nested array from $Array[3] ? Posted the code in case anyone else would like to follow along
  11. '?do=embed' frameborder='0' data-embedContent>> Look at the responses from PsaltyDS. Hope that helps.
  12. Yes, AutoIt is capable of doing these things As far as putting the "exe in the autoIt shell", I think you mean adding another program as a resource and yes. FileInstall() function will help you.
  13. ; Press Esc to terminate script, Pause/Break to "pause" #Include<IE.au3> Global $Paused HotKeySet("{`}", "Terminate") $sUserName = InputBox("", "Please enter your username: ") ;Get data from the input Terminate($sUserName) ;use it later to change the name Func Terminate($uname) $oIE = _IECreate ("website") $oForm = _IEFormGetObjByName ($oIE, "MAIN") $oQuery1 = _IEFormElementGetObjByName ($oForm, "SITE") $oQuery2 = _IEFormElementGetObjByName ($oForm, "LOGON_ID") $sin="1001" $uname ;This has been set before the function was called and will remain the same as the value that was input for the duration of the script _IEFormElementSetValue ($oQuery1,$sin) _IEFormElementSetValue ($oQuery2,$uname) $oButton=_IEGetObjById($oIE,"ENTER") _IEAction ($oButton, "click") _IELoadWait($oIE,0) EndFunc ;==>Terminate
  14. Maybe what you want is possible without an array, like this: $Test = InputBox("Some Title", "Some Prompt") While 1 ;Loop forever ConsoleWrite("The value of $Test is: " & $Test & @CRLF) ;Write it out to the console Sleep(5000) ;Stop for 5 seconds, then start the loop over Wend
×
×
  • Create New...