
digitalexpl0it
Active Members-
Posts
26 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by digitalexpl0it
-
I am trying to use the example code from But when I try it I get the GUi loaded then it closes. Is there a new way to load RDP on windows 10/2016 with AutoIT? #include <GUIConstants.au3> #include <Array.au3> $width = 1024 $height = 768 $oRDP = ObjCreate("MsTscAx.MsTscAx.10") $GUI = GUICreate("Embedded RDP control Test", $width+20, $height+20, 0, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, $width, $height) GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO) GUISetState() ; connect to the server. if this is not done first, the child controls are not rendered. ; which is a problem, because we have to change their styles to prevent clipping $oRDP.Server = "" $oRDP.Domain = "" $oRDP.UserName = "" $oRDP.Connect() ; Determine the class name of the ATL control - it seems to be random from system to system Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Opt("WinSearchChildren", 1) ;0=no, 1=search children also $sATLClass = "" $aClasses = StringSplit(WinGetClassList($GUI,""),@LF) For $i = 1 To $aClasses[0] If StringLeft($aClasses[$i],4) = "ATL:" Then $sATLClass = $aClasses[$i] ExitLoop EndIf Next ; get the handles to the controls that must have their styles modified $hUIContainerClass = ControlGetHandle($GUI, "", "[CLASS:UIContainerClass]") $hUIMainClass = ControlGetHandle($GUI, "", "[CLASS:UIMainClass]") $hATL = ControlGetHandle($GUI, "", "[CLASS:"&$sATLClass&"]") ConsoleWrite("$hUIContainerClass (should not be 0 or blank):" & $hUIContainerClass & @crlf) ConsoleWrite("$hUIMainClass (should not be 0 or blank):" & $hUIMainClass & @crlf) ConsoleWrite("$hATL (should not be 0 or blank):" & $hATL & @crlf) ; modify the styles of the child controls to match those set by the offical client application ; this prevents clipping problems - though, I don't know why Const $WS_EX_NOPARENTNOTIFY1 = 0x4 Const $WS_EX_NOINHERITLAYOUT1 = 0x100000 $hUIContainerClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000 $hUIContainerClassStyleEx = BitOR($WS_EX_NOINHERITLAYOUT1, $WS_EX_NOPARENTNOTIFY1) ; 0x00100004 $hUIMainClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_SYSMENU, $WS_VISIBLE) ; 0x56080000 $hUIMainClassStyleEx = 0x0 $hATLStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000 $hATLStyleEx = 0x0 $guiStyle = BitOR($WS_BORDER, $WS_CAPTION, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_DLGFRAME, $WS_GROUP, $WS_MAXIMIZE, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_TABSTOP, $WS_THICKFRAME, $WS_VISIBLE) ; 0x17CF0100 $guiStyleEx = $WS_EX_WINDOWEDGE ; 0x00000100 _SetStyle($hUIContainerClass,$hUIContainerClassStyle,$hUIContainerClassStyleEx) _SetStyle($hUIMainClass,$hUIMainClassStyle,$hUIMainClassStyleEx) _SetStyle($hATL,$hATLStyle,$hATLStyleEx) _SetStyle($gui,$guiStyle,$guiStyleEx) Func _SetStyle($hwnd,$style,$exstyle) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -16, "long", $style) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -20, "long", $exstyle) EndFunc ; $WS_EX_NOPARENTNOTIFY and $WS_EX_NOINHERITLAYOUT seem to be fairly important ; This may still be important for other projects with similar problems. AdlibRegister ( "checkconn", 1000) Func checkconn() If $oRDP.Connected = 0 Then msgbox(0,"RDP","You got Disconnected: " & $oRDP.Connected) ;_arraydisplay($oRDP) Exit EndIf EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit
-
Help with Nested For loop
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
that was it, I ended up tweaking the ini file to look like this [test1] [test2] [test3] which is fine since they will be directory names then changed the following code to ; Read ini file Local $aArray = IniReadSectionNames($sFilePath) ; Start the array loop If Not @error Then for $i = 1 to $aArray[0] ; Add Ini values into array _ArrayAdd($ExArray, $aArray[$i]) next endif thanks for your help -
Help with Nested For loop
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
doh, maybe thats why it skips it. now to figure out how to exclude sub directories per ini file -
Hello, I am trying to updated a autoit app that moves files from one location to another. What Ia m trying to do is exclude specified sub directories from being moved/copied or files within the sub-folders As of now the code doesn't want to execute the nested for loop Global $szDrive, $szDir, $szFName, $szExt Global $File = "*" func File_mover($Src,$File,$Dst) ; GET DIRECTORY EXCLUDES ; ###################### ; Create blank 2 dem array Local $ExArray[0][1] ; load ini file Local Const $sFilePath = "exclude.ini" ; Check to see if ini exists Local $iFileExists = FileExists($sFilePath) ; If the INI file is not found, output error message If not $iFileExists Then msgbox(0,"Oh NO!", $sFilePath & " not found!") endif ; Read ini file Local $aArray = IniReadSection($sFilePath, "test") ; Start the array loop If Not @error Then for $i = 1 to $aArray[0][0] ; Add Ini values into array _ArrayAdd($ExArray, $aArray[$i][1]) next endif ; Display array ;_ArrayDisplay($ExArray, "test Label") ProgressOn("Moving Scanned File(s)", "Moving scans into citrix...", "0%") $aFiles = _FileListToArray3($Src, $File, 1, 1, 0, 0) For $i = 1 To $aFiles[0] call("_PathSplit",$aFiles[$i], $szDrive, $szDir, $szFName, $szExt) $SrcFile = $Src & "\" & $szDrive & $szDir & $szFName & $szExt $DstFile = $Dst & "\" & $szDir & $szFName & $szExt $NumFiles = DirGetSize($Src,1) ; If File Exsists copy and rename file If FileExists($DstFile) Then $DstFile = call("_IfIdenticalIncrement", $SrcFile, $DstFile) If $DstFile <> "" Then For $ii = $NumFiles[1] To 100 Step 10 ProgressSet($ii, $ii & "%","Moving Files...") ; Move Scans ; List Dir in srouce dir $dirEx = _FileListToArray($Src,"*",2) If UBound($dirEx) > 1 Then ; Look in the dir list array For $dir In $dirEx ; Find and compaire dir in exclude array For $exclude In $ExArray If ($dir = $exclude) Then ; if exclude dir found go to top loop and skip ContinueLoop 2 EndIf Next FileMove($SrcFile, $DstFile, 8) Next endif Sleep(100) Next EndIf ; File doesnt exists so copy the file over Else For $ii = $NumFiles[1] To 100 Step 10 ProgressSet($ii, $ii & "%","Moving Files...") ; Move Scans ; List Dir in srouce dir $dirEx = _FileListToArray($Src,"*",2) If UBound($dirEx) > 1 Then ; Look in the dir list array For $dir In $dirEx ; Find and compaire dir in exclude array For $exclude In $ExArray If ($dir = $exclude) Then ; if exclude dir found go to top loop and skip ContinueLoop 2 EndIf Next FileMove($SrcFile, $DstFile, 8) Next endif Sleep(100) next EndIf ProgressSet(100, "Scans Moved...Successfully!", "Done!") sleep(2000) ProgressOff() Next endfunc Func _IfIdenticalIncrement($vSrcFile, $vDstFile) Local $Count = 0 ; Get the modified date of the source file. $ScrVer = FileGetTime($vSrcFile, 0, 1) ; To get all elemnt of the distination file (in plan to add incremental number). call("_PathSplit",$vDstFile, $szDrive, $szDir, $szFName, $szExt) ; Loop to increment the name of the file. While FileExists($vDstFile) $Count += 1 $vDstFile = $szDrive & $szDir & $szFName & "(" & $Count & ")" & $szExt WEnd ; If file(1), it assume that is the first copy. If $Count = 1 Then Return $vDstFile ; If file(x-1) is identical then assume the file is already duplicated. ElseIf $ScrVer = FileGetTime($szDrive & $szDir & $szFName & "(" & $Count - 1 & ")" & $szExt, 0, 1) Then Return "" ; Else assume it is a new version. Else Return $vDstFile EndIf EndFunc ;==>_IfIdenticalIncrement This part is skipped and not sure why For $exclude In $ExArray If ($dir = $exclude) Then ; if exclude dir found go to top loop and skip ContinueLoop 2 EndIf Next INI file is this [test] EXCLUDE1=test1 EXCLUDE2=test2 EXCLUDE3=test3
-
Auto Generate Buttons
digitalexpl0it replied to digitalexpl0it's topic in AutoIt GUI Help and Support
OK I will start there thanks -
Hello, I wanted to know if it was possible to auto-generate buttons from a ini file. The thought was to read the ini and for each value create a button for it. Now I would like to have the buttons places from left to right then after lets say 5 buttons have created move down to the next row and start again with lets say a limit of 8 rows. INI example: [Buttons] Button1Text=Test 1 Button1Command=http://google.com Button2Text=Test 2Button2Command=cmd.exe Any help would be appreciated
-
Ini to combo box
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
basically it just dumps to the ini file as a history, in which I can pull from and show in a combobox, I could use a txt file for this since the history file will jsut keep growing, but an option to set other ini header sections was mentioned so I started it this way. May not be the best way. -
Ini to combo box
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
So the next thing is, how would I check for duplicates when writing to the ini file? I have a function to write to the ini file like this. But it just adds to the end of the file. Not sure how to check to not write if a duplicate is found func _WriteHistory($txt) ; Open the file for writing (append to the end of a file) and store the handle to a variable. Local $hFileOpen = FileOpen("history1.ini", $FO_APPEND) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "Error: Cant write to history1.ini") ;Return False FileClose($hFileOpen) EndIf FileWriteLine($hFileOpen, "HOST=" & $txt & @CRLF) ; Close the handle returned by FileOpen. FileClose($hFileOpen) endfunc -
Ini to combo box
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
DOH, thank you. Wasn't thinking there about counting by Two, removing the $i=$i+1 worked. Thank you, Just needed another set of eyes on this. -
hello, I am having an issue were I am trying to pull everything under a section in a INI file into a combobox.Issue I have is it only selects 2 out of the list. Not sure why func _ReadHistory() Local Const $sFilePath = "history1.ini" Local $iFileExists = FileExists($sFilePath) ; If the INI file is not found, output error message If not $iFileExists Then msgbox(0,"Oh NO!", $sFilePath & " not found!") endif Local $aArray = IniReadSection($sFilePath, "RemoteHistory") ; Start the array loop and run robocopy If Not @error Then for $i = 0 to $aArray[0][0] _GUICtrlComboBox_InsertString($rdesktopInput, $aArray[$i][1], 0) $i = $i +1 next endif endfuncINI FILE Example [RemoteHistory] HOST=12.12.12.12 HOST=127.0.0.1 HOST=10.10.10.1 HOST=192.168.1.1 HOST=0.0.0.0
-
Hello All, I have found a FileListToArray function that will search a location and find a certain file extension then put it into an array, What I am trying to figure out is how to only list the ones with multpile files in the directory. In this case I am looking for *.ost files only. I want to see what folders have more than one OST file in them so that I can delete the oldest one. Here is the array function #include <Array.au3> Global $a1, $b1 $b1 = _FileListToArrayEx("O:\", "*.ost", 12) ;_ArrayDisplay($b1,"OST Found") global $maxa = Ubound($b1) for $i = 0 to $maxa -1 msgbox(0,"test",$b1[$i]) next ; #FUNCTION# ======================================================================================================================== ; Name...........: _FileListToArray ; Description ...: Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch) ; Syntax.........: _FileListToArray($sPath[, $sFilter = "*"[, $iFlag = 0]]) ; Parameters ....: $sPath - Path to generate filelist for. ; $sFilter - Optional the filter to use, default is *. (Multiple filter groups such as "All "*.png|*.jpg|*.bmp") Search the Autoit3 helpfile for the word "WildCards" For details. ; $iFlag - Optional: specifies whether to return files folders or both Or Full Path (add the flags together for multiple operations): ; |$iFlag = 0 (Default) Return both files and folders ; |$iFlag = 1 Return files only ; |$iFlag = 2 Return Folders only ; |$iFlag = 4 Search subdirectory ; |$iFlag = 8 Return Full Path ; Return values .: @Error - 1 = Path not found or invalid ; |2 = Invalid $sFilter ; |3 = Invalid $iFlag ; |4 = No File(s) Found ; Author ........: SolidSnake <MetalGX91 at GMail dot com> ; Modified.......: ; Remarks .......: The array returned is one-dimensional and is made up as follows: ; $array[0] = Number of Files\Folders returned ; $array[1] = 1st File\Folder ; $array[2] = 2nd File\Folder ; $array[3] = 3rd File\Folder ; $array[n] = nth File\Folder ; Related .......: ; Link ..........: ; Example .......: Yes ; Note ..........: Special Thanks to Helge and Layer for help with the $iFlag update speed optimization by code65536, pdaughe ; Update By DXRW4E ; =================================================================================================================================== Func _FileListToArrayEx($sPath, $sFilter = "*", $iFlag = 0) Local $hSearch, $sFile, $sFileList, $iFlags = StringReplace(BitAND($iFlag, 1) + BitAND($iFlag, 2), "3", "0"), $sSDir = BitAND($iFlag, 4), $FPath = "", $sDelim = "|", $sSDirFTMP = $sFilter $sPath = StringRegExpReplace($sPath, "[\\/]+\z", "") & "\" ; ensure single trailing backslash If Not FileExists($sPath) Then Return SetError(1, 1, "") If BitAND($iFlag, 8) Then $FPath = $sPath If StringRegExp($sFilter, "[\\/:><]|(?s)\A\s*\z") Then Return SetError(2, 2, "") If Not ($iFlags = 0 Or $iFlags = 1 Or $iFlags = 2 Or $sSDir = 4 Or $FPath <> "") Then Return SetError(3, 3, "") $hSearch = FileFindFirstFile($sPath & "*") If @error Then Return SetError(4, 4, "") Local $hWSearch = $hSearch, $hWSTMP = $hSearch, $SearchWD, $sSDirF[3] = [0, StringReplace($sSDirFTMP, "*", ""), "(?i)(" & StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace("|" & $sSDirFTMP & "|", '\|\h*\|[\|\h]*', "\|"), '[\^\$\(\)\+\[\]\{\}\,\.\=]', "\\$0"), "\|([^\*])", "\|^$1"), "([^\*])\|", "$1\$\|"), '\*', ".*"), '^\||\|$', "") & ")"] While 1 $sFile = FileFindNextFile($hWSearch) If @error Then If $hWSearch = $hSearch Then ExitLoop FileClose($hWSearch) $hWSearch -= 1 $SearchWD = StringLeft($SearchWD, StringInStr(StringTrimRight($SearchWD, 1), "\", 1, -1)) ElseIf $sSDir Then $sSDirF[0] = @extended If ($iFlags + $sSDirF[0] <> 2) Then If $sSDirF[1] Then If StringRegExp($sFile, $sSDirF[2]) Then $sFileList &= $sDelim & $FPath & $SearchWD & $sFile Else $sFileList &= $sDelim & $FPath & $SearchWD & $sFile EndIf EndIf If Not $sSDirF[0] Then ContinueLoop $hWSTMP = FileFindFirstFile($sPath & $SearchWD & $sFile & "\*") If $hWSTMP = -1 Then ContinueLoop $hWSearch = $hWSTMP $SearchWD &= $sFile & "\" Else If ($iFlags + @extended = 2) Or StringRegExp($sFile, $sSDirF[2]) = 0 Then ContinueLoop $sFileList &= $sDelim & $FPath & $sFile EndIf WEnd FileClose($hSearch) If Not $sFileList Then Return SetError(4, 4, "") Return StringSplit(StringTrimLeft($sFileList, 1), "|") EndFuncAny help is appreciated.
-
Parse File - By Keyword
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
Have a little trouble not sure why I get an error at $aArray[$count] = StringStripWS($temp,1), it works then the last two that it fins it doesn't like the array. #include <Array.au3> #include <File.au3> local $user = @username RunWait(@ComSpec & ' /c ldifde -l proxyAddresses,objectClass -f ' & $user & '.txt -r "(proxyAddresses=smtp:' & $user & '@foobar.com)"') sleep(1000) Local $aRetArray, $sFilePath = $user & ".txt", $aArray[6], $count, $temp _FileReadToArray($sFilePath, $aRetArray) If @error Then Exit MsgBox(0, "Error", "Error") For $i = 1 To UBound($aRetArray) - 1 If StringInStr($aRetArray[$i], "proxyAddresses:") Then $temp = StringTrimLeft($aRetArray[$i], 15) $count += 1 $aArray[$count] = StringStripWS($temp,1) if ($aArray[$count] <> "") then msgbox(0,"",$aArray[$count]) endif EndIf NextText file dn: CN=John Doe,OU=Valley,OU=California,OU=Agencies,DC=foo,DC=bar changetype: add objectClass: top objectClass: person objectClass: organizationalPerson objectClass: user proxyAddresses: smtp:[email protected] proxyAddresses: SMTP:[email protected] proxyAddresses: smtp:[email protected] proxyAddresses: smtp:[email protected] proxyAddresses: X500:/o=ExchangeLabs/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Rec ipients/cn=3aec3f9078ee4a2a8c4c058d3df3f6c0-Elizabeth N proxyAddresses: smtp:[email protected] proxyAddresses: smtp:[email protected] N/M I see that the array was set to 6 and more data was beeing added, upped it to 10 and its fine -
Parse File - By Keyword
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
You guys rock, thanks that is what I was looking for -
Hello, I am not sure where to start on this, but maybe some help from the community will help. I understand how to open a file and read it with autoit. My issue is this, I need to be able to select all the data on certain lines of the file by a keyword. I have a file that has multiple lines with the word "proxyAddresses:" that starts at the beginning of each line I want, there are other lines with other information I do not want. How can I select what I want and put it into an array? Example of file dn: CN=John Doe,OU=Techs,OU=Users,DC=foo,DC=bar changetype: add objectClass: top objectClass: person objectClass: organizationalPerson objectClass: user proxyAddresses: X500:/o=FooBar/ou=Exchange Administrative Group (FYDI)/cn=Re cipients/cn=Jogn Doec52 proxyAddresses: x500:/o=ExchangeLabs/ou=Exchange Administrative Group (FYSPDLT)/cn=Rec ipients/cn=3ab8cd9xxxxxxxxxxxxxxxxxxxxxf64e0c-John Do proxyAddresses: sip:[email protected] proxyAddresses: smtp:[email protected] proxyAddresses: SMTP:[email protected]
-
Kill process of current user only
digitalexpl0it replied to JakeLD's topic in AutoIt General Help and Support
Something like this should work local $strComputer = @ComputerName ; What process to kill local $strProcessName = "notepad.exe" local $objWMI = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") local $colProcesses = $objWMI.ExecQuery("Select * from Win32_Process Where Name = '"& $strProcessName & "'") local $intCount = $colResults.Count for $objProcess in $colProcesses if $objProcess.GetOwner(@UserName, @LogonDomain) = 0 then $objProcess.Terminate() endif next ; Exit script exit -
Check Radio Button External App
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
got it working Opt("WinTitleMatchMode", 2) while true $win = winwaitactive("Night Utilities Setup") if $win <> "" Then ; msgbox(0,"","found") endif ControlCommand($win, "", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d; INSTANCE:38]", "Check", "") wend -
Hello, I am trying to figure out how to have autoit automatically check a radio button on a external application I have tried the following without any success. Opt("WinTitleMatchMode", 1) while true $win = winwaitactive("Night Utilities Setup") if $win <> "" Then ; msgbox(0,"","found") endif ;ControlClick($win, "Sunday", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d:rbtnSunday]", "left", 1, 48, 13) ControlCommand($win, "Sunday", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d:rbtnSunday]", "Check") wendHere is the window info >>>> Window <<<< Title: Night Utilities Setup Class: WindowsForms10.Window.8.app.0.33c0d9d Position: 110, 103 Size: 790, 547 Style: 0x16CB0000 ExStyle: 0x00050180 Handle: 0x0012020C >>>> Control <<<< Class: WindowsForms10.BUTTON.app.0.33c0d9d Instance: 38 ClassnameNN: WindowsForms10.BUTTON.app.0.33c0d9d38 Name: rbtnSunday Advanced (Class): [NAME:rbtnSunday] ID: 1049020 Text: Sunday Position: 63, 119 Size: 104, 16 ControlClick Coords: 48, 13 Style: 0x5600000B ExStyle: 0x00000000 Handle: 0x001001BC >>>> Mouse <<<< Position: 114, 170 Cursor ID: 0 Color: 0x2B2F37 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< &Run Now &Apply &Cancel &OK Programs To Run One Agency All Agencies Validate Cash Balances To Range All Clients Rename Codes Rebuild Sections 11:45:00 PM Saturday Use Customized Time For Batch Update From Files Delete All Files in AS_TEMP and AS_LOCK Batch Change Activity File Change Request Updates Real-Time Alerts IVANS Transmission Run Pseudo Post Prepare Company Reconciliations Validate Receivables Validate Client Balances Maintenance Options Dequeue Reports Database Maintenance Processing Mode Distributed Stand Alone File Selection FIM Only TAM Only All Files Maintenance Operations * You cannot scan with delete and pack Smaller Than Backup Data Files Before Pack Pack Data Files * Reindex Data Files Delete Unfixed Records * Fix Corrupt Records Print Scan Results Scan for Corrupt Records Day and Time 11:45:00 PM Sunday Saturday Friday Thursday Wednesday Tuesday Monday >>>> Hidden Text <<<< any help would be appreciated.
-
Looking for multiple files in a directory
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
thank you for the reply, it seems to only pull the first created OST and not the last accessed -
Hello, I am trying to look into multiple folders for outlook OST's. What I need is if there are more than one, delete the oldest one in that directory then move to the next directory. I am not to sure on how to compare and detect multiple OSTs in a folder. So far my script will search all the subdirectories in a given path and prompt me with the OST's found. How to I check for more than one OST and delete the oldest? Folder structure example: OSTS - user1 - User1.ost - User2 - User2.ost -User2_dup.ost Etc... ; Script Start - Add your code below here #include <Array.au3> ; Only required to display the arrays #include <File.au3> #include <MsgBoxConstants.au3> Local $sOSTDir = "\\server1\osts\" $aArray = _FileListToArrayRec($sOSTDir, "*.ost", $FLTAR_RECUR, $FLTAR_SORT) for $i = 1 to $aArray[0] $time = FileGetTime($sOSTDir & $aArray[$i], 2); 0 if for modified date $dmyyyy = $time[3]& ":" & $time[4] & ":" & $time[5]&'_'&$time[1]& "/" & $time[2] & "/" & $time[0] msgbox(0,"test", $aArray[$i] & " | Date: " & $dmyyyy) next Any help would be appreciated.
-
INI Array Help Needed
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
Sweet that worked, didn't know about the step that makes things a lot easier. -
Hello I am trying to pull everything from a section in a ini file but need to batch it by each 4 lines then move to the next four lines in the section my message box shows me the correct information but when it loops I get an error at $WorkingDir = $aArray[$iii][1]. So the idea is to have many entries under the [shortcuts] section without any limits. ; Read the INI section. This will return a 2 dimensional array. Local $aArray = IniReadSection($ssFilePath, "Shorcuts") If Not @error Then for $i = 1 to $aArray[0][0] ; Set new timer $ii = $i $iii = $ii $iiii = $iii $ProgramEXEFullPath = $aArray[$i][1] ; update Timer to pull next line in INI file $ii = $i + 1 $LNKPath = StringReplace($aArray[$ii][1],"[USERNAME]", @UserName) $LNKPath = StringReplace($LNKPath,"[PROFILEPATH]", @UserProfileDir) ; update Timer to pull next line in INI file $iii = $ii + 1 $WorkingDir = $aArray[$iii][1] ; update Timer to pull next line in INI file $iiii = $iii + 1 $Desc = $aArray[$iiii][1] ; debug msgbox msgbox(0,"INI File Varibles", $ProgramEXEFullPath & " | " & $LNKPath & " | " & $WorkingDir & " | " & $Desc) ; loop $i = $i +1 next else msgbox(0,"Ahh Snap!", "Cannot read shortcuts.ini file, possible format incorrect or file currupted.") endif here is INI file [Shorcuts] ProgramEXEFullPath=C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE LNKPath=C:\Users\[USERNAME]\Desktop\Word 2010.lnk WorkingDir=C:\Program Files (x86)\Microsoft Office\Office14 Desc=Microsoft Word 2010 Not sure why it errors, I am doing this using 2 lines but I cant get the erorr to stop using 4, any help is greatly appreciated.
-
Start on windows startup issues
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
so I tried the windows startup folder and I get the same issue, if I remove #RequireAdmin from the launcher script it will run but can execute the man script. I just tried a cmd file to launch the main script from the startup folder and thats working. I will try the registry after this -
Hello, I have a script that puts itself into the SoftwareMicrosoftWindowsCurrentVersionRun registry. When I reboot the computer then log in the application will not launch. Setting the reg keys script func SetProgramAutoRun($PathToFile, $autorunName="LGComputerMigration") ; Write a single REG_SZ value ; Put script into the registry to launch on login If @ProcessorArch = "X86" Then RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\Run", '"' & $autorunName & '"', "REG_SZ", $PathToFile) Call("WriteToLog", "[SUCCESS] Setup autorun in the registry for " & $PathToFile) endif If @ProcessorArch = "X64" Then RegWrite("HKLM64\Software\Microsoft\Windows\CurrentVersion\Run", '"' & $autorunName & '"', "REG_SZ", $PathToFile) Call("WriteToLog", "[SUCCESS] Setup autorun in the registry for " & $PathToFile) endif endfunc func DelProgramAutoRun($PathToFile, $autorunName="LGComputerMigration") If @ProcessorArch = "X86" Then RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", '"' & $autorunName & '"') Call("WriteToLog", "[SUCCESS] Deleted autorun in the registry for " & $PathToFile) endif If @ProcessorArch = "X64" Then RegDelete("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", '"' & $autorunName & '"') Call("WriteToLog", "[SUCCESS] Deleted autorun in the registry for " & $PathToFile) endif endfunc The script is set with SetProgramAutoRun("c:migrationscript.exe") I do see the entry in the registry and it looks fine. I even tried creating a launcher script to launch the main script on boot-up but I get the same issue. #RequireAdmin Local Const $Path = "c:\migration" Local Const $ssFilePath = $Path & "\settings.ini" Local $iiFileExists = FileExists($ssFilePath) If not $iiFileExists Then msgbox(0,"Ahh Snap!", $ssFilePath & " file was not found") exit endif ; Read the INI sections. This will return a 2 dimensional array. Local $aOptions = IniReadSection($ssFilePath, "Options") If Not @error Then Local $PathToFile = $aOptions[5][1] else msgbox(0,"Error","Unable to read INI file, please check file. " & @error) endif ; Run the main script RunWait($PathToFile) exit Not sure why it wont launch
-
INI File Loop option
digitalexpl0it replied to digitalexpl0it's topic in AutoIt General Help and Support
thanks that works, I guess I didnt need to specify the numbers of loops