8 posts in this topic
Copy folder and file names and write them to a text file
Basically I'm looking to make a snapshot of a whole HD's folders and files in one text file. Just the names. Preferably in alphabetical order.
Is there a function that can copy just the names without opening the files? An alternative would be to put each into rename mode and then copy the text, but that is going to be painfully slow.
Help with OutlookEX - Sending Email/ Monitoring File
I am trying to use the latest version of OutlookEx.au3 and my script is able to send the email to the user first time but second time I am getting this error (see attached) I am trying to check a file every min and verify if the file has been modified, if the file was not modified then an email is sent. It works for the first time but fails in the second iteration. Also, attaching my code, I am very new to AutoIT, any help would be much appreciated!
#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <MsgBoxConstants.au3> #include <Debug.au3> #include <File.au3> #include <WinAPI.au3> #include <GuiComboBox.au3> #include <Date.au3> #include <AutoItConstants.au3> #include <Array.au3> #include <Process.au3> #include <StringConstants.au3> #include <FileConstants.au3> ; include for file functions #include <WinAPIFiles.au3> #include <_SingleScript.au3> #include <WinNet.au3> #include <Timers.au3> #include <INet.au3> #include <OutlookEX.au3> #include <DateCalc.au3> #Region AutoIT_Options Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=No case Opt("WinSearchChildren", 1) ;0=no, 1=search children also Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info Opt("TrayAutoPause", 0) ; 0 = no pause , 1 = pause when tray icon is clicked #EndRegion AutoIT_Options Global $logFileName = "Test" & "-" & @YEAR &"_"&@MON& "." & "log" Global $logfile = @ScriptDir &"\"& $logFileName Global $LastModTime Global $LastModTime Global $LastModTimeStamp Global $FiletoCheck_1 Global $FiletoCheck_2 Global $oOutlook = _OL_Open() Func _SendAlert() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ;Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name ;_OL_Wrapper_SendMail($oOutlook, $sCurrentUser, "", "", "Travel Time Calc Engine ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh _OL_Wrapper_SendMail($oOutlook, "email@example.com", "", "", "ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) ;MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") _OL_Close($oOutlook) EndFunc Func _ChecklogFile() $FiletoCheck_2 = FileGetTime($logfile, 0, 1) ; Timestamp If $FiletoCheck_1 == $FiletoCheck_2 Then ; if the time stamp has not changed Msgbox("","","File has not changed") _SendAlert() Else Msgbox("","","File has changed") EndIf EndFunc ; Initial Launch, grab current GetTime $FiletoCheck_1 = FileGetTime($logfile,0,1) Local $YYYY = StringLeft ( $FiletoCheck_1, 4 ) Local $MM = StringMid ( $FiletoCheck_1,5,2) Local $DD = StringMid ( $FiletoCheck_1,7,2 ) Local $HH = StringMid ( $FiletoCheck_1,9,2 ) Local $Min = StringMid ( $FiletoCheck_1,11,2 ) Local $SS = StringMid ( $FiletoCheck_1,13,2 ) $LastModTimeStamp = $YYYY&"-"&$MM&"-"&$DD&" "&$HH&":"&$Min&":"&$SS While 1 Sleep(60000) ; check every 10 mins _ChecklogFile() WEnd
Program doesn't write to files
I've written a short program that calculates all values of a mathematical function in a user-defined interval. The data is written to an user-defined file during that process. Unfortunately, there is no file. I don't have a clue what's wrong with my program, and I've been trying to solve that for nearly 2 hours now. Obviously without success.
The calculation is done properly (added a ConsoleWrite() to check that), so it must be the FileWrite() that doesn't work.
Thanks for the help!
[SOLVED] ClipGet() consumes 100% of CPU resources
I have problem with ClipGet () function: If the clipboard contains a large amount of data the use of the function pushes the consumption of cpu resources to 100% and my script unresponds until I force it to end.
I tried to work around the problem by limiting the size of the recovered data from the clipboard
Local = $ClipBoardData = StringMid(ClipGet (), 1.1024) I also used:
DllCall ("psapi.dll", "int", "EmptyWorkingSet", "long", -1) to free the memory after each call to ClipGet ()
File into list view and other
Hi Everyone, Happy New Year
Well, I have a script that gather information about a given switch here at work that output data in a txt file:
What I'd like to do first is to put the file in a list view with the possibility to sort the ports by VLAN, by ports or by Status (and also delete all that concern Duplex / Speed / Type).
In a second time, I'd like to bold and color "connected" in green / "disconnected" in red and "err-disabled" in gray. Then, I'd like also to apply a certain color depending on the VLAN number (I have the list of them).
And to finish (sorry ^^) when I double click on a list item, I'd like to retrieve information of the selected line for me to do some operation on it.
I know this is quite an ask but this is something I don't know how to (don't worry, I've done some researches before) do and also, I'm not familiar with arrays at all.
Many thanks for those who can help
I've uploaded the output txt file: EPES18.txt