Monday, November 17, 2008

Symantec Antivirus Removal And Other Tips

Symantec AntiVirus (SAV) Removal:

My Favorive Manual Way: http://tinyurl.com/2dgmow

Automatic Way: SCSCleanWipe3.1.zip

http://tinyurl.com/5vfhx9

Request it from Symantec or contact me and i will email it to you.

Remove a few items CleanWipe leaves: http://tinyurl.com/599mwx

Norton AntiVirus (NAV) automatically: http://tinyurl.com/7eqv8

Uninstall without a password for removal:

http://tinyurl.com/5chfaz

Misc Symantec problems:

http://tinyurl.com/5zn8e9

Monday, October 6, 2008

Copy and Paste My Scripts

If anyone has any issues copying my scripts, as in everything pasting on one line, just do the following:

Paste into wordpad or word, not notepad or autoitscript.

Then save the file as an .au3.

You should then be able to open it in notepad or the Scite editor properly.

Outlook CSV Import

OutlookCSVImport - Import a CSV file into Outlook.
Match up the necessary fields and modify the script if needed. Remove or add any additional fields.

Based on http://tinyurl.com/4uce9k
Download Microsoft Outlook VBA Language Reference for other properties that were not listed here.

There were 4 properties in an export i originally created this for that do not have a corresponding field in Outlook. I added them as part of the Body field (notes field).

The script will add the excel file into the default Outlook Contacts folder. Something to keep in mind while testing :)

Sort the Excel file by the FileAs field. My export came from http://www.codetwo.com/ Outlook export tool.
The client this was made for had custom fields that Outlook would not export out. The third party tool did a great job.
Renamed a few of the custom contact fields to what was needed and set the rest to be part of notes.
Outlook's natural import/export function with the "Map Custom Fields" does not work correctly. Quite a few existing Outlook fields,
do not export or import, even while it creates a csv column entry for the field (nickname is one example).
Called Microsoft on this issue. Will see what answer they come up with.

If the program crashes at any point look for the contact that crashed it, i had a field with a #name? in it that caused a crash.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=OutlookCSVImport.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs
    OutlookCSVImport - Import a CSV file into Outlook.
    Match up the necessary fields and modify the script if needed. Remove or add any additional fields.
    
    Based on http://tinyurl.com/4uce9k
    Download Microsoft Outlook VBA Language Reference for other properties that were not listed here.
    
    There were 4 properties in an export i originally created this for that do not have a corresponding field in Outlook.
    I added them as part of the Body field (notes field).
    
    The script will add the excel file into the default Outlook Contacts folder. Something to keep in mind while testing :)
    
    Sort the Excel file by the FileAs field. My export came from http://www.codetwo.com/ Outlook export tool.
    The client this was made for had custom fields that Outlook would not export out. The third party tool did a great job.
    Renamed a few of the custom contact fields to what was needed and set the rest to be part of notes.
    Outlook's natural import/export function with the "Map Custom Fields" does not work correctly. Quite a few existing Outlook fields,
    do not export or import, even while it creates a csv column entry for the field (nickname is one example).
    Called Microsoft on this issue. Will see what answer they come up with.
    Visit http://nyitsupport.blogspot.com for an update.
    
    If the program crashes at any point look for the contact that crashed it, i had a field with a #name? in it that caused a crash.
        
    Alex Belenkiy 
    ab@nyitsupport.com
    10/06/08
    
#ce
 
 
Const $olContactItem = 2
 
$objOutlook = ObjCreate("Outlook.Application")
 
$objExcel = ObjCreate("Excel.Application")
$ExcelFile = FileOpenDialog("Please choose an Excel file to open", @WorkingDir, "Excel Files (*.xls;*.xlsx;*.csv)",1)
$objWorkbook = $objExcel.Workbooks.Open($ExcelFile)
 
$x = 2
 
Do 
    $objContact = $objOutlook.CreateItem($olContactItem)
    ;---------------------------------------------------------------------------------------------
    $objContact.AssistantName = $objExcel.Cells($x,2).Value
    $objContact.AssistantTelephoneNumber =     $objExcel.Cells($x,3).Value
    $objContact.Body = "Assistant's Email: " & $objExcel.Cells($x,1).Value & @CRLF & "Contact Type: " & $objExcel.Cells($x,13).Value & @CRLF & "Contacts: " & $objExcel.Cells($x,14).Value & @CRLF & "Cross Street: " & $objExcel.Cells($x,15).Value & @CRLF & "Private Number: " & $objExcel.Cells($x,49).Value & @CRLF & @CRLF & @CRLF & $objExcel.Cells($x,4).Value
    $objContact.BusinessAddress = $objExcel.Cells($x,5).Value
    $objContact.BusinessAddressCity = $objExcel.Cells($x,6).Value
    $objContact.BusinessAddressPostalCode = $objExcel.Cells($x,7).Value
    $objContact.BusinessAddressState = $objExcel.Cells($x,8).Value
    $objContact.BusinessAddressStreet = $objExcel.Cells($x,9).Value
    $objContact.Categories = $objExcel.Cells($x,10).Value
    $objContact.CompanyName = $objExcel.Cells($x,11).Value
    $objContact.PrimaryTelephoneNumber = $objExcel.Cells($x,12).Value
    $objContact.Email1Address = $objExcel.Cells($x,16).Value
    $objContact.Email1DisplayName = $objExcel.Cells($x,17).Value
    $objContact.Email2Address = $objExcel.Cells($x,18).Value
    $objContact.Email2DisplayName = $objExcel.Cells($x,19).Value
    $objContact.Email3Address = $objExcel.Cells($x,20).Value
    $objContact.Email3DisplayName = $objExcel.Cells($x,21).Value
    $objContact.BusinessFaxNumber = $objExcel.Cells($x,22).Value
    $objContact.HomeFaxNumber = $objExcel.Cells($x,23).Value
    $objContact.OtherFaxNumber = $objExcel.Cells($x,24).Value
    $objContact.FileAs = $objExcel.Cells($x,25).Value
    $objContact.FirstName = $objExcel.Cells($x,26).Value
    $objContact.FullName =     $objExcel.Cells($x,27).Value
    $objContact.HomeAddress = $objExcel.Cells($x,28).Value
    $objContact.HomeAddressCity = $objExcel.Cells($x,29).Value
    $objContact.HomeAddressPostalCode = $objExcel.Cells($x,30).Value
    $objContact.HomeAddressState = $objExcel.Cells($x,31).Value
    $objContact.HomeAddressStreet = $objExcel.Cells($x,32).Value
    $objContact.JobTitle = $objExcel.Cells($x,33).Value
    $objContact.LastName = $objExcel.Cells($x,34).Value
    $objContact.MiddleName = $objExcel.Cells($x,35).Value
    $objContact.Nickname = $objExcel.Cells($x,36).Value
    $objContact.OtherAddress = $objExcel.Cells($x,37).Value
    $objContact.OtherAddressCity = $objExcel.Cells($x,38).Value
    $objContact.OtherAddressPostalCode = $objExcel.Cells($x,39).Value
    $objContact.OtherAddressState = $objExcel.Cells($x,40).Value
    $objContact.OtherAddressStreet = $objExcel.Cells($x,41).Value
    $objContact.BusinessTelephoneNumber = $objExcel.Cells($x,42).Value
    $objContact.Business2TelephoneNumber = $objExcel.Cells($x,43).Value
    $objContact.CarTelephoneNumber = $objExcel.Cells($x,44).Value
    $objContact.CompanyMainTelephoneNumber = $objExcel.Cells($x,45).Value
    $objContact.HomeTelephoneNumber = $objExcel.Cells($x,46).Value
    $objContact.MobileTelephoneNumber = $objExcel.Cells($x,47).Value
    $objContact.OtherTelephoneNumber = $objExcel.Cells($x,48).Value
    $objContact.Spouse = $objExcel.Cells($x,50).Value
    $objContact.Subject = $objExcel.Cells($x,51).Value
    $objContact.Title = $objExcel.Cells($x,52).Value
    $objContact.WebPage = $objExcel.Cells($x,53).Value
    ;---------------------------------------------------------------------------------------------
    $objContact.Save
    $x = $x + 1
Until $objExcel.Cells($x,25).Value = ""
$objExcel.Quit

Wednesday, August 13, 2008

HP Server locking up / freezing / not responding after Windows 2003 SP2 upgrade

If anyone runs into any issues with an HP Proliant ML350 G5 or other Proliant server after installing Windows 2003 SP2, take a look at the following link for a resolution.

http://tinyurl.com/66vyga

This is caused by the Smart Array SAS/SATA controller driver version 6.6.0 or earlier.

Just download and install the latest driver available on the web site.

Tuesday, August 5, 2008

DirList – Directory enumerator / Excel report maker

This script will enumerate a folder and create an excel spreadsheet based on it.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=DirList.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs
    DirList
        Alex Belenkiy - ab@nyitsupport.com
        08/05/2008
        
        This script was created with the purpose of enumerating a folder and its contents into an excel file.
        To use just select the starting path and wait for the Excel sheet to show up.
        Make sure the machine this is executed on has Excel installed.
        
        RecursiveFileSearch function was modified from http://www.autoitscript.com/forum/index.php?showtopic=58558&st=0
#ce
 
#include <array.au3>
#include <file.au3>
#include <GUIConstants.au3>
 
;AutoItSetOption("TrayIconHide", 1)
 
$Path = FileSelectFolder("Please select the folder to enumerate", "",4)
if @error then Exit
$excel = ObjCreate("Excel.Application")
$excel.visible = 0
$excel.workbooks.add
$row = 1
$col = 1
with $excel.activesheet
    .cells($row,$col).value = "Listing of " & $Path
    .cells($row,$col).font.bold = True
    .cells($row,$col).font.size = 20
    .cells($row + 3,$col).value = $Path
    .cells($row + 3,$col).font.bold = True
    $row = $row + 4
    $col = $col + 1
EndWith
 
 
$Array = RecursiveFileSearch($Path)
;_ArrayDisplay($Array)
$excel.visible = 1
;$excel.activeworkbook.saveas("Shared.xls")
$excel = 0
 
Func RecursiveFileSearch($RFSstartDir, $RFSpattern = ".", $RFSdepth = 0)
    ;Ensure starting folder has a trailing slash
    If StringRight($RFSstartDir, 1) <> "\" Then $RFSstartDir &= "\"
 
    If $RFSdepth = 0 Then
        ;Get count of all files in subfolders for initial array definition
        $RFSfilecount = DirGetSize($RFSstartDir, 1)
        Global $RFSarray[$RFSfilecount[1] + 1]
    EndIf
   
    $RFSsearch = FileFindFirstFile($RFSstartDir & "*.*")
    If @error Then Return
 
    ;Search through all files and folders in directory
    While 1
        $RFSnext = FileFindNextFile($RFSsearch)
        If @error Then ExitLoop
       
        ;If folder, recurse
        If StringInStr(FileGetAttrib($RFSstartDir & $RFSnext), "D") Then
            with $excel.activesheet
                .cells($row,$col).font.bold = True
                .cells($row,$col).value = $RFSnext
                $row = $row + 1
                $col = $col + 1
            EndWith
            RecursiveFileSearch($RFSstartDir & $RFSnext, $RFSpattern, $RFSdepth + 1)
            $col = $col - 1
        Else
            If StringRegExp($RFSnext, $RFSpattern, 0) Then
                with $excel.activesheet
                    .cells($row,$col).value = $RFSnext
                    $row = $row + 1
                EndWith
            EndIf
        EndIf
    WEnd
    FileClose($RFSsearch)
 
    If $RFSdepth = 0 Then
        Redim $RFSarray[$RFSarray[0] + 1]
        Return $RFSarray
    EndIf
EndFunc   ;==>RecursiveFileSearch

Thursday, July 24, 2008

Archiver – Archive out older files by modified date.

This script was created with a purpose of archiving old files from one location to another.

To use, select the date of files to be archived, files on or before that day will be affected.
Type the source folder, all files within the source will be affected. Folder structure will remain.
Select whether to copy, or move the files.
Select whether to create shortcuts to the moved files in the source folder.
There is also an undo function that will put files back based on the log.

Please let me know if there are any bugs in it.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=archiver.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs
    Archiver.
        Alex Belenkiy - ab@nyitsupport.com
        07/24/2008
        
        This script was created with a purpose of archiving old files from one location to another.
        
        To use, select the date of files to be archived, files on or before that day will be affected.
        Type the source folder, all files within the source will be affected. Folder structure will remain.
        Select whether to copy, or move the files. 
        Select whether to create shortcuts to the moved files in the source folder.
        There is also an undo function that will put files back based on the log.
        
        RecursiveFileSearch function was modified from http://www.autoitscript.com/forum/index.php?showtopic=58558&st=0
#ce
 
#include <array.au3>
#include <file.au3>
#include <GUIConstants.au3>
 
AutoItSetOption("TrayIconHide", 1)
dim $LogArray 
dim $jobRunning = "0"
dim $PreSetDate = @YEAR & @MON & @MDAY
dim $errorSet = "0"
dim $fileMove, $Array, $copyMove, $destFolder, $fileMove, $FilePathSplit, $NewDestFolder, $oldFile, $OldFolder, $OldPathSplit
dim $FileTotalSize, $fileSize
dim $FileModDate
dim $UNC
 
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=\\ny1221fs01\abelenkiy$\my documents\dev\nyitsupport\archiver\frmarchiver.kxf
$frmArchiver = GUICreate("Archiver", 395, 243, 343, 243)
GUISetOnEvent($GUI_EVENT_CLOSE, "frmArchiverClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "frmArchiverMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "frmArchiverMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "frmArchiverRestore")
$lblDate = GUICtrlCreateLabel("Select files modified on or before:", 8, 8, 176, 21, $SS_CENTER)
$Date1 = GUICtrlCreateDate("2008/07/14 17:59:24", 192, 8, 194, 21, $WS_TABSTOP)
GUICtrlSetOnEvent(-1, "Date1Change")
$btnSource = GUICtrlCreateButton("Source Folder", 8, 40, 97, 21, 0)
GUICtrlSetOnEvent(-1, "btnSourceClick")
$btnDest = GUICtrlCreateButton("Destination Folder", 8, 70, 97, 21, 0)
GUICtrlSetOnEvent(-1, "btnDestClick")
$radMove = GUICtrlCreateRadio("Move", 8, 104, 65, 25)
GUICtrlSetOnEvent(-1, "radMoveClick")
$radCopy = GUICtrlCreateRadio("Copy", 72, 104, 65, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetOnEvent(-1, "radCopyClick")
$chkShortcuts = GUICtrlCreateCheckbox("Create Shortcuts In Source Folder", 144, 104, 241, 25)
GUICtrlSetOnEvent(-1, "chkShortcutsClick")
GUICtrlSetState(-1, $GUI_DISABLE)
$btnOK = GUICtrlCreateButton("OK", 40, 136, 148, 49)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetOnEvent(-1, "btnOKClick")
$btnUndo = GUICtrlCreateButton("Undo", 216, 136, 140, 49)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetOnEvent(-1, "btnUndoClick")
$txtSource = GUICtrlCreateInput("", 112, 40, 273, 21)
$txtDest = GUICtrlCreateInput("", 112, 70, 273, 21)
$lblStatus = GUICtrlCreateLabel("", 8, 192, 380, 25, $SS_CENTER)
$lblCredits1 = GUICtrlCreateLabel("Alex Belenkiy", 8, 224, 76, 17)
GUICtrlSetFont(-1, 6, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008080)
$lblCredits2 = GUICtrlCreateLabel("ab@nyitsupport.com", 277, 224, 108, 17)
GUICtrlSetFont(-1, 6, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008080)
GUICtrlSetState($btnOK, $GUI_DISABLE)
GUICtrlSetState($btnDest, $GUI_DISABLE)
GUICtrlSetState($txtSource, $GUI_DISABLE)
GUICtrlSetState($txtDest, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
 
 
GuiCtrlSendMsg($Date1, 0x1032, 0, "yyyyMMdd")
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd
 
 
While 1
    Sleep(100)
WEnd
 
Func btnOKClick()
    $FileTotalSize = 0
    $fileSize = 0
    $PreSetDate = GUICtrlRead($Date1)
    $sourceFolder = GUICtrlRead($txtSource)
    $destFolder = GUICtrlRead($txtDest)
    if GUICtrlRead($radCopy) = $GUI_CHECKED then $copyMove = "Copy"
    if GUICtrlRead($radMove) = $GUI_CHECKED then $copyMove = "Move"
    if GUICtrlRead($chkShortcuts) = $GUI_CHECKED then 
        $shortCut = "yes"
    Else
        $shortCut = "no"
    EndIf
    $jobRunning = "1"
    GUICtrlSetState($txtSource, $GUI_DISABLE)
    GUICtrlSetState($btnSource, $GUI_DISABLE)
    GUICtrlSetState($btnDest, $GUI_DISABLE)
    GUICtrlSetState($btnOK, $GUI_DISABLE)
    GUICtrlSetState($btnUndo, $GUI_DISABLE)
    GUICtrlSetState($Date1, $GUI_DISABLE)
    GUICtrlSetState($frmArchiver, $GUI_DISABLE)
    GUICtrlSetState($radCopy, $GUI_DISABLE)
    GUICtrlSetState($radMove, $GUI_DISABLE)
    GUICtrlSetState($chkShortcuts, $GUI_DISABLE)
    GUICtrlSetData($lblStatus, "Please wait for the operation to complete.")
    If StringRight($sourceFolder, 1) <> "\" Then $sourceFolder &= "\"
    If StringRight($destFolder, 1) <> "\" Then $destFolder &= "\"
    $logFile = FileOpen ("Archiver - " & $CopyMove & " - " & @MON & "-" & @MDAY & "-" & @YEAR & " - " & @HOUR & "-" & @MIN & ".csv",9)
    FileWriteLine ($logFile, "Operation,Shortcut Created,Date,Time,File Size,File Modified Date,Source Folder,Source File,Destination Folder")
    $Array = RecursiveFileSearch($sourceFolder)
    For $a = 1 To $Array[0]
        $NewDestFolder = $destFolder
        $FilePathSplit = StringSplit($Array[$a], "\")
        if StringInStr($Array[$a], "\\") <> 0 then $UNC = 4
        if StringInStr($Array[$a], ":") <> 0 then $UNC = 2
        for $b = $UNC to $FilePathSplit[0] - 1
            $NewDestFolder = $NewDestFolder & $FilePathSplit[$b] & "\"
        Next
        $oldFile = $FilePathSplit[$FilePathSplit[0]]
        
        $OldPathSplit = StringSplit($Array[$a], "\")
        $OldFolder = StringLeft($Array[$a], StringLen($Array[$a]) - StringLen($OldPathSplit[$OldPathSplit[0]]))
        $FileTotalSize = $FileTotalSize + $fileSize
        $fileSize = FileGetSize ($Array[$a])
        $FileModDate = StringLeft (FileGetTime ($array[$a], 0,1), 8)
        if $copyMove = "Move" Then $fileMove = FileMove($Array[$a], $NewDestFolder , 9)
        if $copyMove = "Copy" Then $fileMove = FileCopy($Array[$a], $NewDestFolder , 9)
        if $fileMove = 1 then FileWriteLine ($logFile, $CopyMove & "," & $ShortCut & "," & @MON & "/" & @MDAY & "/" & @YEAR & "," & @HOUR & ":" & @MIN & ":" & @SEC & "," & $fileSize & "," & $FileModDate & "," & $OldFolder & "," & $oldFile & "," & $NewDestFolder)        
        if $ShortCut = "yes" then FileCreateShortcut($NewDestFolder & $oldFile, $OldFolder & $oldFile, $NewDestFolder, "", "Link to file that was moved by ARCHIVER")
        GUICtrlSetData($lblStatus, "Processing " & $a & " / " & $array[0] & @crlf & $array[$a])
    Next
    FileWriteLine($logFile, "-------")
    FileWriteLine($logFile, "Number of files:" & $Array[0])
    FileWriteLine($logFile, "Total size of files: " & Round($FileTotalSize / 1048576, 3) & " MB" & " / " & Round($FileTotalSize / 1073741824, 3) & " GB" )
    FileClose($logFile)
    $jobRunning = "0"
    GUICtrlSetState($btnSource, $GUI_ENABLE)
    GUICtrlSetState($btnDest, $GUI_ENABLE)
    GUICtrlSetState($btnOK, $GUI_ENABLE)
    GUICtrlSetState($btnUndo, $GUI_ENABLE)
    GUICtrlSetState($Date1, $GUI_ENABLE)
    GUICtrlSetState($frmArchiver, $GUI_ENABLE)
    GUICtrlSetState($radCopy, $GUI_ENABLE)
    GUICtrlSetState($radMove, $GUI_ENABLE)
    if GUICtrlRead($radMove) = $GUI_CHECKED Then GUICtrlSetState($chkShortcuts, $GUI_ENABLE)
    GUICtrlSetData($lblStatus, "")
    MsgBox(0, "Job Complete", "Number of files:" & $Array[0] & @CRLF & "Total size:" & @CRLF & Round($FileTotalSize / 1048576, 3) & " MB" & @CRLF & Round($FileTotalSize / 1073741824, 3) & " GB")
EndFunc
 
Func btnUndoClick()
    dim $undoCount
    $logPath = FileOpenDialog("Select log file with undo information", @WorkingDir, "(*.csv)", 1)
    if not @error Then
        $UndoLog = FileOpen ("Archiver - UNDO - " & @MON & "-" & @MDAY & "-" & @YEAR & " - " & @HOUR & "-" & @MIN & ".csv",9)
        FileWriteLine ($UndoLog, "Status,Archived Folder,Archived File,Restore Folder")
        $jobRunning = "1"
        GUICtrlSetState($btnSource, $GUI_DISABLE)
        GUICtrlSetState($btnDest, $GUI_DISABLE)
        GUICtrlSetState($btnOK, $GUI_DISABLE)
        GUICtrlSetState($btnUndo, $GUI_DISABLE)
        GUICtrlSetState($Date1, $GUI_DISABLE)
        GUICtrlSetState($frmArchiver, $GUI_DISABLE)
        GUICtrlSetState($radCopy, $GUI_DISABLE)
        GUICtrlSetState($radMove, $GUI_DISABLE)
        GUICtrlSetState($chkShortcuts, $GUI_DISABLE)
        $logFile = FileOpen($logPath,0)
        $undoCount = _FileCountLines($logPath)
        dim $undoArray[$undoCount]
        _FileReadToArray($logPath, $undoArray)
        for $a = 2 to $undoArray[0] - 3
            if $undoArray[$a] = "-------" then ExitLoop
            $uSplit = StringSplit($undoArray[$a], ",") ;Operation[1],Shortcut Created[2],Date[3],Time[4],File Size[5],File Date[6],Source Folder[7],Source File[8],Destination Folder[9]
            if FileExists($uSplit[7] & $uSplit[8]) Then
                $fileSizeSource = FileGetSize($uSplit[9] & $uSplit[8]) ; archive location
                $fileSizeDest = FileGetSize($uSplit[7] & $uSplit[8]) ; original location
                $fileModSource = StringLeft(FileGetTime($uSplit[9] & $uSplit[8], 0, 1),8)
                $fileModDest = StringLeft(FileGetTime($uSplit[7] & $uSplit[8],0,1),8)
                $replace = MsgBox(36, "File Exists", "Would you like to replace the existing file?" & @CRLF & $uSplit[7] & $uSplit[8] & @CRLF & "Size: " & $fileSizeDest & @CRLF & "Date: " & $fileModDest & @CRLF & @crlf & "With archived file?" & @CRLF & "Size: " & $fileSizeSource & @CRLF & "Date: " & $fileModSource & @CRLF & @crlf & "Will skip the file in 30 seconds", 30)
                if $replace = 6 Then 
                    $fileDelete = FileMove($uSplit[9] & $uSplit[8], $uSplit[7],9)
                    if $fileDelete = 1 then 
                        if $uSplit[2] = "yes" then FileDelete($uSplit[7] & $uSplit & ".lnk")
                        FileWriteLine($UndoLog, "Success - Replaced existing file" & "," & $uSplit[9] & "," & $uSplit[8] & "," & $uSplit[7])
                    Else
                        FileWriteLine($UndoLog, "Failed - Could not replace existing file" & "," & $uSplit[9] & "," & $uSplit[8] & "," & $uSplit[7])
                    EndIf
                Else
                    FileWriteLine($UndoLog, "Failed - Existing file replace prompt declined or timed out" & "," & $uSplit[9] & "," & $uSplit[8] & "," & $uSplit[7])
                EndIf
            Else
                $filedelete = FileMove($uSplit[9] & $uSplit[8], $uSplit[7],9)
                if $fileDelete = 1 Then
                    if $uSplit[2] = "yes" then FileDelete($uSplit[7] & $uSplit[8] & ".lnk")
                    FileWriteLine($UndoLog, "Success - Replaced moved file" & "," & $uSplit[9] & "," & $uSplit[8] & "," & $uSplit[7])
                Else
                    FileWriteLine($UndoLog, "Failed - Could not replace moved file" & "," & $uSplit[9] & "," & $uSplit[8] & "," & $uSplit[7])
                EndIf
            EndIf
            GUICtrlSetData($lblStatus, "Processing " & $a & " / " & $undoArray[0] - 4 & @CRLF & $uSplit[7] & $uSplit[8])
        Next
        FileClose($UndoLog)
        $jobRunning = "0"
        GUICtrlSetState($btnSource, $GUI_ENABLE)
        GUICtrlSetState($btnDest, $GUI_ENABLE)
        GUICtrlSetState($btnOK, $GUI_ENABLE)
        GUICtrlSetState($btnUndo, $GUI_ENABLE)
        GUICtrlSetState($Date1, $GUI_ENABLE)
        GUICtrlSetState($frmArchiver, $GUI_ENABLE)
        GUICtrlSetState($radCopy, $GUI_ENABLE)
        GUICtrlSetState($radMove, $GUI_ENABLE)
        if GUICtrlRead($radMove) = $GUI_CHECKED Then GUICtrlSetState($chkShortcuts, $GUI_ENABLE)
        GUICtrlSetData($lblStatus, "")
        MsgBox(0, "Undo Completed", "Completed " & $undoArray[0] - 4 & " Files." & @CRLF & "Please check the UNDO log file for any errors.")
    EndIf
EndFunc
 
Func chkShortcutsClick()
 
EndFunc
 
Func Date1Change()
 
EndFunc
 
Func frmArchiverClose()
    if $jobRunning <> "1" then Exit
EndFunc
 
Func frmArchiverMaximize()
 
EndFunc
 
Func frmArchiverMinimize()
 
EndFunc
 
Func frmArchiverRestore()
 
EndFunc
 
Func radCopyClick()
    GUICtrlSetState($chkShortcuts, $GUI_DISABLE)
    GUICtrlSetState($chkShortcuts, $GUI_UNCHECKED)
EndFunc
 
Func radMoveClick()
    GUICtrlSetState($chkShortcuts, $GUI_ENABLE)
    GUICtrlSetState($chkShortcuts, $GUI_CHECKED)
EndFunc
 
Func btnDestClick()
    $destFolder = FileSelectFolder("Destination Folder", "",5)
    if not @error then 
        $c = StringSplit($destFolder,"\")
        if not @error Then
            GUICtrlSetState($btnOK, $GUI_ENABLE)
            GUICtrlSetData($txtDest, $destFolder)    
        EndIf
    EndIf    
EndFunc
 
Func btnSourceClick()
    GUICtrlSetState($btnDest, $GUI_DISABLE)
    $sourceFolder = FileSelectFolder("Source Folder", "",4)
    if not @error then 
        $c = StringSplit($sourceFolder,"\")
        if not @error Then
            GUICtrlSetState($btnDest, $GUI_ENABLE)
            GUICtrlSetData($txtSource, $sourceFolder)    
        EndIf
    EndIf
EndFunc
 
Func RecursiveFileSearch($RFSstartDir, $RFSpattern = ".", $RFSdepth = 0)
   
    ;Ensure starting folder has a trailing slash
    If StringRight($RFSstartDir, 1) <> "\" Then $RFSstartDir &= "\"
 
    If $RFSdepth = 0 Then
        ;Get count of all files in subfolders for initial array definition
        $RFSfilecount = DirGetSize($RFSstartDir, 1)
        Global $RFSarray[$RFSfilecount[1] + 1]
    EndIf
   
    $RFSsearch = FileFindFirstFile($RFSstartDir & "*.*")
    If @error Then Return
 
    ;Search through all files and folders in directory
    While 1
        $RFSnext = FileFindNextFile($RFSsearch)
        If @error Then ExitLoop
       
        ;If folder, recurse
        If StringInStr(FileGetAttrib($RFSstartDir & $RFSnext), "D") Then
            RecursiveFileSearch($RFSstartDir & $RFSnext, $RFSpattern, $RFSdepth + 1)
        Else
            If StringRegExp($RFSnext, $RFSpattern, 0) Then
                ;Append filename to array
                $FileDate = StringLeft (FileGetTime ($RFSstartDir & "\" & $RFSnext, 0,1), 8)
                if $FileDate <= $PreSetDate Then    
                    $RFSarray[$RFSarray[0] + 1] = $RFSstartDir & $RFSnext
                    $RFSarray[0] += 1
                EndIf
                ;Increment filecount
                
            EndIf
        EndIf
    WEnd
    FileClose($RFSsearch)
 
    If $RFSdepth = 0 Then
        Redim $RFSarray[$RFSarray[0] + 1]
        Return $RFSarray
    EndIf
EndFunc   ;==>RecursiveFileSearch