zykl0 Posted January 29, 2009 Share Posted January 29, 2009 Hello! At job we need to fil up an excel sheet every week with every project we worked on. The major problem is half of people doesnt remember what project they worked on 2 day ago. For a better accurancy i would like to create a script that run 24/24 and monitor in a .log every file opened/closed something similar as this. 09/01/15 8:00am: Open "C:\Program Files\AutoCAD 2007\acad.exe" 09/01/15 8:02am: Open "T:\Project 2009\0922 project x\ground.floor.dwg" 09/01/15 2:00pm: Open "T:\Project 2009\0922 project x\fax.xls" 09/01/15 2:05pm: Close "T:\Project 2009\0922 project x\fax.xls" 09/01/15 4:00pm: Close "T:\Project 2009\0922 project x\ground.floor.dwg" Someone know how to do this? I am not qualified enough to write this, i have searched around on net but i cant find something that fit my need and are Free ! thank you Link to comment Share on other sites More sharing options...
Inverted Posted January 29, 2009 Share Posted January 29, 2009 (edited) As a starting suggestion, you should look in the registry. I'm sure Excel drops more than enough info and file history there :-) For example, doesn't it save the most recent files opened in the registry ? Edited January 29, 2009 by Inverted Link to comment Share on other sites More sharing options...
Authenticity Posted January 29, 2009 Share Posted January 29, 2009 #include <File.au3> Opt('MustDeclareVars', 1) Dim $Path = @MyDocumentsDir & '\..\Recent' Dim $Arr, $sHeader, $sDate, $i $sDate = @MON & '/' & @MDAY & '/' & @YEAR & @TAB & @HOUR & ':' & @MIN & ':' & @SEC $sHeader = @CRLF & @CRLF & '****************************************************************' & @CRLF & _ ' Current date "Recent" folder content: (' & $sDate & ')' & @CRLF & _ '****************************************************************' & @CRLF If FileExists($Path) Then Local $hFile = FileOpen('C:\DailyLog.log', 1) If @error Then ConsoleWrite('Could not open file' & @CRLF) Exit EndIf FileWrite($hFile, $sHeader) $Arr = _FileListToArray($Path, '*') For $i = 1 To $Arr[0] FileWriteLine($hFile, StringTrimRight($Arr[$i], 4)) Next FileClose($hFile) Else MsgBox(0x10, 'Title', 'Descriptive Error', 5) EndIf Link to comment Share on other sites More sharing options...
zykl0 Posted January 30, 2009 Author Share Posted January 30, 2009 #include <File.au3> Opt('MustDeclareVars', 1) Dim $Path = @MyDocumentsDir & '\..\Recent' Dim $Arr, $sHeader, $sDate, $i $sDate = @MON & '/' & @MDAY & '/' & @YEAR & @TAB & @HOUR & ':' & @MIN & ':' & @SEC $sHeader = @CRLF & @CRLF & '****************************************************************' & @CRLF & _ ' Current date "Recent" folder content: (' & $sDate & ')' & @CRLF & _ '****************************************************************' & @CRLF If FileExists($Path) Then Local $hFile = FileOpen('C:\DailyLog.log', 1) If @error Then ConsoleWrite('Could not open file' & @CRLF) Exit EndIf FileWrite($hFile, $sHeader) $Arr = _FileListToArray($Path, '*') For $i = 1 To $Arr[0] FileWriteLine($hFile, StringTrimRight($Arr[$i], 4)) Next FileClose($hFile) Else MsgBox(0x10, 'Title', 'Descriptive Error', 5) EndIf Do i need a file called #include <File.au3> ? Because it generate a list without date/hour sample, and from MONTHS ago! this is huge! eg: $28952-702-703-704 $28952-707 $28952-708-709-1 $28952-N13 00-Borderaux de transmission 00-Fax 001-Page couverture (Fiches Technique).doc 002-Table des matières.doc 01-Résultat hydraulique Link to comment Share on other sites More sharing options...
Bert Posted January 30, 2009 Share Posted January 30, 2009 First, You may want to take the AutoIt 1 2 3 class. It will teach you the basics of AutoIt. Second, are you only looking for certain file types such as Word docs, txt, Excel files, and so forth? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now