Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/05/2011 in all areas

  1. Valik

    Latest Beta

    From the changelog for 3.3.7.22: - Changed: Dec(), Int(), Number() have second optional parameter defining non-default behavior.
    1 point
  2. jchd, Thanks for the compliments, but I would only class myself as an apprentice guru at best. amakrkr, Are you still out there? M23
    1 point
  3. kylomas, Pretty close. Remember that SREs are "greedy" by default and so always look for the largest possible match (unless you tell them otherwise of course) So the SRER translates as: (.*) - Capture as many characters as you can until... . - you find a . (because of the "greediness" this will always be the final one)... .* - which is followed by any number of characters (so we can ignore the length of the extension) $1 - Replace the whole lot with the captured groupAll clear? I always recommend this site as a good place to learn about SREs - and GEOSoft's PCRE Toolkit (look in his sig) as a good way to play with them to see exactly what they do. M23 Edit: I see jchd looking in - stand by for incoming!
    1 point
  4. kylomas, Very true! M23
    1 point
  5. kylomas, Which is why I used an SRER to get the name. If you try it you will see that it removes only the final extension, no matter how long it is: $sFileName_1 = "mynew.doc" $sFileName_2 = "my.new.docx" $sStripped_1 = StringRegExpReplace($sFileName_1, "(.*)..*", "$1") $sStripped_2 = StringRegExpReplace($sFileName_2, "(.*)..*", "$1") MsgBox(0, "Stripped", $sStripped_1 & @CRLF & $sStripped_2) Convinced now? M23
    1 point
  6. amakrkr, You need to use FileGetTime to check the timestamp of the files that match. This does what you want when I test it: #include <Array.au3> #include <File.au3> $File = @ScriptDir & "test.dat" $file_open = FileOpen($File, 2) ; Force another file to exist with the same timestamp FileOpen(@ScriptDir & "test.dbl", 2) $Path = $CmdLine[1] ; Force a trailing If StringRight($Path, 1) <> "" Then $Path &= "" $filename = $CmdLine[2] ; get list of files on path $List = _FileListToArray($Path, "*", 1) ; Create an array to hold any matching files Global $aMatches[$List[0] + 1][2] = [[0]] For $i = 1 To UBound($List) - 1 ; Delete the extension - using SRER means we can ignore the size of the extension $sListCut = StringRegExpReplace($List[$i], "(.*)..*", "$1") ; Does it match the required string If StringCompare($sListCut, $filename) = 0 Then ; Increase the count $aMatches[0][0] += 1 ; Store the file name $aMatches[$aMatches[0][0]][0] = $List[$i] ; Store the modified time - remove the SS at then end of the string $aMatches[$aMatches[0][0]][1] = StringTrimRight(FileGetTime($Path & $List[$i], 0, 1), 2) EndIf Next ; Just for display _ArrayDisplay($aMatches, "Final") If $aMatches[0][0] > 1 Then ; Look at each turn For $i = 1 To $aMatches[0][0] - 1 ; And try to match with all subsequent For $j = 2 To $aMatches[0][0] ; Do the timestamps match If $aMatches[$i][1] = $aMatches[$j][1] Then ; Write to the file FileWrite($file_open, $Path & $aMatches[$i][0] & @CRLF) EndIf Next Next EndIf ; Empty the array $aMatches = 0 FileClose($file_open)Please ask if you have any questions. M23
    1 point
  7. Hi, I try to do some ondemand screen capture to monitor some machines on the network. I have two autoit scripts, a sender (on pc1) who send mailslot to request a screencapture, and a listener (on pc2), running in the user session, who listen mailslot, get it, and do a screencapture. Now : - if pc2 have its session opened or locked, screencapture works nice, even when the session is locked I get the capture of the windows of the user desktop. - if I connect to pc2 with rdp, the listener script get a black screencapture - if I connect to pc2 with rdp, then close the rdp connection (the session stay opened on pc2), , the listener script get a black screencapture So, how can I get a screencapture of the screen on pc2 when pc2 have been rdp connected and then unconnected ? The scripts themselves are pretty simple, I use mailslot UDF, then on the listener when a mailslot beginning by 'screen' is detedted it does : _ScreenCapture_Capture(@ScriptDir&"\FullScreen_"&@ComputerName&".jpg") Any idea would be nice, having this function working would really rocks to monitor some calculating machines that we connect to only via rdp (there is no one working on the machine). EDIT : all machines on win7 pro x64, with nvidia cards, on a domain (I am network admin in case gpo etc required) Kib
    1 point
×
×
  • Create New...