I've been checking the logging UDFs in the wiki, mostly Log4a and Loga and I wanted to ask which one would you recommend for a script that will be executed remotely through PSExec. My main question is where the logs are located in that situation and if I can change that location to a custom one., because I need to retrieve them at the end of execution.
So in a rough description the process is
Send compiled AutoIT script to remote machine
Copy logs from the remote to the local machine.
I've encountered a problem with a single file where I cannot retrieve it's Date-time. So far my code has worked well for over 30 files, but this one is a mystery I cannot debug myself due to insufficient Au3 knowledge.
In line 11 "_Date_Time_FileTimeToArray" is called and for this particular file it sets the @error to 10. I don't know what that error code means, but it's not set by the _Date functions themselves I think.
Overall, it could be a problem caused by any of the functions below, how can I properly debug this? / Does anybody know a what's causing this?
_WinAPI_CreateFile() / _Date_Time_GetFileTime() / _Date_Time_FileTimeToArray()
Func _SetFileTimes($sFilePath) Local $monthNumber = ["", "January", "February", "March", "April", "May", "Juny", "July", "August", "September", "October", "November", "December"] Local $dayNumber = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] Local $fHandle = _WinAPI_CreateFile($sFilePath, 2, 2) ; read-only ; may NOT return a valid date for some reason! TODO Local $fTagFILETIME = _Date_Time_GetFileTime($fHandle) _WinAPI_CloseHandle($fHandle) ; This will return an empty array if theres no valid date $fModTime = _Date_Time_FileTimeToArray($fTagFILETIME) ; last Modified if @error <> 10 then Local $year = $fModTime Local $month = $fModTime Local $day = $fModTime Local $hour = $fModTime Local $min = $fModTime Local $sec = $fModTime Local $ms = $fModTime Local $weekday = $fModTime Global $prettyTimestamp = StringFormat("%s, %s %d, %04d %02d:%02d:%02d", $dayNumber[$weekday], $monthNumber[$month], $day, $year, $hour, $min, $sec) Global $uploadDate = StringFormat("%04d-%02d-%02d", $year, $month, $day) $fModTime = _Date_Time_FileTimeToArray(_Date_Time_FileTimeToLocalFileTime($fTagFILETIME)) ; last Modified Local $year = $fModTime Local $month = $fModTime Local $day = $fModTime Local $hour = $fModTime Local $min = $fModTime Local $sec = $fModTime Local $ms = $fModTime Local $weekday = $fModTime ; GetUnixTime accounts for Local time, hence feed it local time Global $unixTimestamp = _GetUnixTime($year &"/"& $month &"/"& $day &" "& $hour&":"& $min &":"& $sec) else Global $prettyTimestamp = "N/A" Global $uploadDate = "" Global $unixTimestamp = "N/A" endif endfunc
_GetUnixTime returned the year 1601 start date, showing that $fModTime is probably equal 0. (But Why?)
The file reports these dates in Explorer, it's on local NTFS drive:
Created: Wednesday, 31. Januar 2018, 18:55:02
Modified: Wednesday, 10. Januar 2018, 12:39:23
Accessed: Wednesday, 10. Januar 2018, 12:39:23
I watched _OL_ItemSend&_OL_ItemFind&_OL_ItemCreate in OutlookEx UDF but hmmm
Since it use the test environnement i cant get the orders of the mail creation
Can someone make me win some time of reading all exemples script and lead me how to do one ?
That whould be lovely.
I'm having a problem whit winwait on firefoxscreens whit the same title and text.
On mine quest on this forum and internet I've found some work around and solutions.
unfortunaly This wasn't working for me.
I've tried searching tru winlist or finding some unique text but wasn't finding any solution.
Does anyone know how to get the wright handle?
I just want to move the browser to the right place in the end whit WinMove.
thnx in advanced.
#include <Array.au3> Global $A_URL = _ [["url1" , "same_title"] , _ ["url2", "same_title"] , _ ["url3" , "other_title" ] , _ ["url4" , "other_title" ]] ;~ _ArrayDisplay($A_URL) ;-----kill all firefox.exe ;~ Run("taskkill /IM firefox.exe /F", "", @SW_HIDE) ;Sleep(5000) For $i = 0 To 1 ConsoleWrite("running 1 : " & $i & @CRLF) Local $ID = ShellExecute("firefox.exe", "-new-window " & $A_URL[$i] ,"C:\Program Files\Mozilla Firefox" ) ConsoleWrite("$ID = " & $ID & @CRLF) Next sleep(200) ;~ Local $screen1HWND = WinWait($A_URL,"") ;~ If Not WinActive($screen1HWND) Then WinActivate($screen1HWND) ;~ ConsoleWrite("$screen1HWND = " & $screen1HWND & @CRLF) ;~ Local $screen2HWND = WinWait($A_URL,"") ;~ If Not WinActive($screen2HWND) Then WinActivate($screen2HWND) ;~ ConsoleWrite("$screen2HWND = " & $screen2HWND & @CRLF) $sWinTitle = $A_URL $avWinList = WinList($sWinTitle) For $n = 1 to $avWinList ConsoleWrite("Window " & $n & ": Text: " & WinGetText($avWinList[$n]) & @LF) Next For $i = 0 To 1 ;~ WinWait("title1", "", 10) ;~ WinActive("title1", "") ;~ WinMove ("title1", "", $i , $i ) Next
Here the this wiki page with list of available UDFs for data compression. For my tasks I only need ZIP support, so I started looking at pure AutoIt UDFs without any 3rd party dlls. And found out that most of available realizations uses standard ("native method") Windows dll - "zipfldr.dll". So for now I chose ZIP UDF by wraithdu. I've tested it on Windows 7 (x64) and it seem works fine. But here the comment from another topic where user says that Windows 10 discontinued support of "zipfldr.dll". Now I confused. I don't have around any Windows 10 machine to tested it. So maybe someone could confirm or deny that? Or maybe would better to switch to UDF with 7zip dll?
I need an advice...