Jump to content

tnek

Active Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by tnek

  1. I am not trying to start anything. The prior excel udf was simple enough my non-programmers could manipulate it if they needed. I am not going to ask them to become proficient in Office objects just so they may manipulate their log files. I am simply going roll back to a prior version of Autoit for them. I picked Autoit for them several years ago as it gave them more power and flexibility than regular batch scripting. The push over the last year or two to make Autoit the equivalent of a full-fledged programming language has moved it beyond their scope.
  2. Meh. Thanks for the replies, but Autoit is becoming too much like VB for my taste. I use it because it is simple enough for my DBA and Network Admins to open and modify on the fly like a batch script, but with more power.
  3. I need a list of properties for the excel udf. For example in post #4 of > water mentions '"Item" is the default property of the Sheets collection.' So where do I find a list of these collections and properties?
  4. Thank you gentlemen. I miss having code reviews. Downsizing sucks.
  5. I have written a script that runs as a scheduled task(batch job) to daily zip up db backups and transaction logs. After the first month I noticed the server memory in use when idle went has gone from 1 GB to 11 GB. A reboot brought the memory back to 1 GB, but after a week we were up to 4 GB. This server is a simple offsite storage device, backups get copied to it by processes on the db server. The only non-OS application running on this server is my zip process. So here is my question: Is the way I have written my zipping/removal process leaving memory hanging so the OS thinks that memory is still allocated to a running process? And as a follow up - What are the best practices to end a program? #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #region ;Includes, Definitions, etc. =============================================================== #include <File.au3> #include <Date.au3> #include <7Zip.au3> #include <Array.au3> #include <Affinity.au3> #include <EventLog.au3> #include "RecFileListToArray.au3" Global $pid Global $aFolders Global $runLoop Global $hEventLog Dim $aData[4] = [0, 0, 0, 0] #endregion ;Includes, Definitions, etc. ============================================================ #region ;Opens ============================================================================== $runLoop = FileExists($CmdLine[1]) If $runLoop = 0 Then $hEventLog = _EventLog__Open("", "CmdLineZip") _EventLog__Report($hEventLog, 1, 0, 2, "Administrator", "Folder does not exist: " & $CmdLine[1], $aData) _EventLog__Close($hEventLog) EndIf If ($CmdLine[4] > 0) Then $pid = _WinAPI_GetCurrentProcessID() ProcessSetAffinity($pid, $CmdLine[4]) EndIf ;~ _ArrayDisplay($CmdLine) #endregion ;Opens =========================================================================== #region ;Main =============================================================================== While $runLoop = 1 If $CmdLine[3] = "1" Then $aFileList = _RecFileListToArray($CmdLine[1], $CmdLine[2], 1, 1, 1, 2) ;~ MsgBox(0, "Recursive File Listing ", "Error: " & @error & " - " & " Extended: " & @extended & @CRLF) Else $aFileList = _RecFileListToArray($CmdLine[1], $CmdLine[2], 1, 0, 1, 2) ;~ MsgBox(0, "Single Folder File Listing ", "Error: " & @error & " - " & " Extended: " & @extended & @CRLF) EndIf If @error = 0 Then For $j = 1 To $aFileList[0] $runLoop = _GoZip($aFileList[$j]) If $runLoop < 1 Then ExitLoop Next $runLoop = 0 Else $runLoop = 0 EndIf WEnd Exit #endregion ;Main ============================================================================ #region ; Functions =========================================================================== ;~ _GoZip - Uses 7Zip to compress file -------------------------------------------------------------------------------------------------------------- Func _GoZip($inName) $vZippedName = $inName & '.7z' $retResult = _7ZipAdd(0, $vZippedName, $inName, 0, 9) $hEventLog = _EventLog__Open("", "CmdLineZip") If $retResult = 0 Then _EventLog__Report($hEventLog, 1, 0, 2, "Administrator", "Failure Zipping: " & $inName, $aData) Return 0 Else $retResult = FileDelete($inName) If $retResult = 0 Then _EventLog__Report($hEventLog, 1, 0, 2, "Administrator", "Failure Removing: " & $inName, $aData) Return 0 Else _EventLog__Report($hEventLog, 0, 0, 2, "Administrator", "Successful Zip and Removal: " & $inName, $aData) Return 1 EndIf EndIf _EventLog__Close($hEventLog) EndFunc ;==>_GoZip #endregion ; Functions ========================================================================
  6. My reply to this seems to have disappeared. We are installing multiple files, folders, shortcuts and links using usb keys on multiple laptops. We can't always count on the usb key being in a set drive.
  7. While I am at it the delete of a shortcut is not working either FileDelete(@DesktopDir&"Shortcut to 2011 General Ballots- Final.lnk")
  8. FileCopy(@WorkingDir & "StudentDirectory.url",@DesktopDir,9) FileCopy(@WorkingDir & "StudentDirectory",@DesktopDir,9) When I do: $array = _FileListToArray("F:") _ArrayDisplay($array) It returns StudentDirectory.url
  9. Did anyone ever solve this? I am experiencing the same problem.
  10. Well here is the current code. The folder monitoring code has not been written yet as time has been limited. ;~ ========================================================================================= ;~ Lets a user pick a folder and currently only 7zips .bak and .trn files ;~ I wrote this to minimize space used on our backup storage server ;~ ;~ by Kent Kroft 2.8.2012 ;~ Version 1.0 ;~ STEAL AND MODIFY AT YOUR PLEASURE - JUST POST YOUR IMPROVEMENTS ;~ ========================================================================================= #region ;Includes, Definitions, etc. =============================================================== #include <File.au3> #include <Date.au3> #include <7Zip.au3> #include <Array.au3> #include <EventLog.au3> Global $aFolders Global $runLoop Global $vPathName Dim $aData[4] = [0, 0, 0, 0] #endregion ;Includes, Definitions, etc. =============================================================== #region ;Opens ============================================================================== $runLoop = 1 $vPathName = FileSelectFolder("Choose a folder.", "", 4) ;~ $vPathName = @DesktopDir ;~ $vPathName = @ScriptDir ;~ $vPathName = 'H:ZippingPractice' If @error Then $runLoop = 0 EndIf #endregion ;Opens ============================================================================== #region ;Main =============================================================================== While $runLoop = 1 $aFileList = _FileListToArray($vPathName, '*', 1) For $j = 1 To $aFileList[0] $t = StringRight($aFileList[$j], 3) If ($t = "bak") Or ($t = "trn") Then $runLoop = _GoZip($vPathName & '' & $aFileList[$j]) EndIf If $runLoop < 1 Then ExitLoop Next $runLoop = 0 WEnd #endregion ;Main =============================================================================== #region ; Functions =========================================================================== Func _GoZip($inName) $vZippedName = StringLeft($inName, (StringLen($inName) - 4)) & "_" & StringRight($inName,3) & '.7z' $retResult = _7ZipAdd(0, $vZippedName, $inName, 0, 9) $hEventLog = _EventLog__Open("", "Folder_Zipper") If $retResult = 0 Then _EventLog__Report($hEventLog, 1, 0, 2, "Administrator", "Failure Zipping: " & $inName, $aData) Return 0 Else $retResult = FileDelete($inName) If $retResult = 0 Then _EventLog__Report($hEventLog, 1, 0, 2, "Administrator", "Failure Removing: " & $inName, $aData) Return 0 Else Return 1 EndIf EndIf _EventLog__Close($hEventLog) EndFunc ;==>_GoZip #endregion ; Functions ===========================================================================
  11. Ok. I am on it. You'll notice I am a noob so don't get too excited.
  12. Before I re-invent the wheel - has anyone written anything to monitor a folder and zip it's contents when something new shows? I want to automate zipping our db backups for offsite storage and was hoping something similar exists. Thanks.
  13. I dropped the dll into c:Windows and used _CommSetDllPath. It is working now. Thanks for your patience.
  14. I am trying to incorporate Martin's Serial Port /COM Port UDF into a script on a Win7 machine to replace some functionality on our legacy system.
  15. Noob here. I come from an old mainframe environment and I don't understand what I am supposed to do with a dll. I have been searching the forums - where do I put the dll? does it need to be registered (and how)? Most of all - I think I need a good link explaining how they work in autoit.
  16. I looked at that post a long time and missed the download link. Please downgrade my status from newbie to dumbass. Sorry.
  17. I am looking for FileSystemMonitor.au3. I have not seen it replaced in the release notes and did not find mention of it being dropped anywhere in the forums. I did a reinstall of the recent release and that did not help. Does anyone know why and con someone post a copy on here?
  18. Thank you!! Thank you!! Thank you!! As a newb I had been struggling with getting ANY connection working. The _sql.au3 solved my problems (I am still working on why). I am testing with SQLExpress 2008 and did not change anything except the server/db name.
  19. Thanks from another noob.
×
×
  • Create New...