none
script para limpar arquivos da publica RRS feed

  • Pergunta

  • Criei o script abaixo para excluir arquivos da pasta publica da rede. Gostaria que o mesmo fosse executado todos os dias a meia noite mas sem usar o gerenciador de tarefas, pois o mesmo anda me "traindo".

    Alguem têm uma sugestão??

     

    Const DeleteReadOnly = TRUE

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.DeleteFile("F:\temp\*.*"), DeleteReadOnly
    objFSO.DeleteFolder("F:\temp\*.*"), DeleteReadOnly

    WScript.Echo "Pasta Publica excluída"

     

    Será que consigo que o mesmo envie e-mail para uma caixa postal quando fosse excluido os arquivos??

     

    att

     

    quinta-feira, 15 de janeiro de 2009 13:03

Respostas

  • A respeito do serviço de agendamento,

    Você já tentou desmarcar a opção: "Stop the Task if it runs for XX hours XX minutes"?

    terça-feira, 20 de janeiro de 2009 19:42

Todas as Respostas

  • Caro colega,

    Tenho um problema parecido com o seu, vc ja tentou fazer com a estação bloqueada?
    sds/MS
    sexta-feira, 16 de janeiro de 2009 19:12
  • Caros, tem como enviar o e-mail sim...

    Acontece que estou sem muito tempo agora mas você podem editar esse script aqui, que faz o backup do SystemState e depois me envia um e-mail informando o que houve(Sucesso ou falha), e de "groja" vocês recebem

    aí um script para backup do AD pelo NTBackup. Abraços,

    Marcelo.

     

    Se ajudou, marca aí...

     

     

     

    Option Explicit


    ' Define Global Variables
    Dim BackupFolder  'Full Path of the Backup Folder (it will contain backup Files and Backup logs)
    Dim MaxLogTime   'Number of days to keep log files (older log files will be deleted)
    Dim MaxNumberBackup  'Number of Backup Files to keep (keep only the last backup file)
    Dim DeleteBeforeBackup  'Indicate if existing backup files should be deleted before performing a backup (use only when there is not enough space on disk)

    Dim BackupRun   'Command line with the paramaters for NTBackup

    Dim WSHShell   'Scripting Host Object
    Dim fso    'File System object
    Dim WshSysEnv   'Environnement access
    Dim NTBackupLogFolder  'Path of the Folder where NTbackup generates log files

    Dim Odir,oFile
    Dim FileName, FileDate, FilePath, Latestlog
    Dim ListFiles
    Dim FileArray, Item1, Item2, ItemTmp, Drv
    Dim strComputer,objWMIService,colLoggedEvents,objEvent, MailText , MailSubject, EventType

    Const ForAppending=8
    Const ForReading=1

     
    ' Create File System Object
    Set fso = CreateObject("Scripting.FileSystemObject")

    ' Create Scripting Host Object
    Set WshShell = Wscript.CreateObject("Wscript.Shell")

    ' Create Environnement Object
    Set WshSysEnv = WshShell.Environment("Process")


    'Initialize Global variables
    'BackupFolder= WshSysEnv("SYSTEMDRIVE") & "\SystemState" 'backup and logs are created in c:\SystemState
    BackupFolder= "C:\SystemState" 'backup and logs are created in c:\SystemState
    MaxLogTime=30    'Delete backup logs older than 30 days
    MaxNumberBackup=3   'keep only the number of backup files specified (keep the most recent backup files)
    DeleteBeforeBackup=0  'Delete all the backup files before performing the backup (use only when there is not enough space on disk)
     
    BackupRun = "NTBACKUP.EXE backup SystemState /v:yes /m normal /j ""QUALQUERNOMESystemState"" /lTongue Tied /f """ & BackupFolder & "\Backup.bkf"""
    'note that the folder of NTBACKUP.EXE is supposed to be in the PATH.

    '---------------------------------------
    ' Perform the Backup
    '--------------------------------------- 
    ' Create the Folder for Backup files if it does not exist
    If Not fso.FolderExists(BackupFolder) Then fso.CreateFolder(BackupFolder)

    'if a file is named like the target backup file, it is deleted
    If fso.FileExists(BackupFolder & "\Backup.bkf") then
     fso.DeleteFile(BackupFolder & "\Backup.bkf")
    End If

    'Specific configuration if there is not enought spave on disk to keep several backup files
    'Delete all the bkf before performing the backup
    If DeleteBeforeBackup=1 Then
     On Error Resume Next
     fso.DeleteFile(BackupFolder & "\*.bkf")
     On Error GoTo 0
    End If

    ' Run NT Backup with options specified
    WshShell.Run BackupRun,0, TRUE

    'Rename the Backup File (bkf) with the date of the day
    If fso.FileExists(BackupFolder & "\Backup.bkf") then
     fso.MoveFile BackupFolder & "\Backup.bkf", BackupFolder & "\QUALQUERNOMESystemState" & DateFileName(now) & ".bkf"
    End If


    '---------------------------------------
    ' Remove Old Backup
    '--------------------------------------- 

    'Read the list of Backup Files
    ListFiles = ""
    Set Odir = fso.GetFolder(BackupFolder)
    For Each oFile in Odir.Files
     If Right(LCase(oFile.Path),3)="bkf" Then
      if ListFiles <> "" then
              ListFiles = ListFiles & "||"
      end if
      ListFiles = ListFiles & oFile.path & "|" & oFile.DateLastModified
     End If
    Next
    Set oDir = nothing

    ' Sort the list by date
    FileArray = split(ListFiles,"||")
    For Item1 = 0 to ubound(FileArray)-1
        for Item2 = Item1+1 to ubound(FileArray)
          If cdate(split(FileArray(Item1),"|")(1))<cdate(split(FileArray(Item2),"|")(1)) then
          'if cdate(split(FileArray(Item1),"|")(1))>cdate(split(FileArray(Item2),"|")(1)) then
            ItemTmp = FileArray(Item1)
            FileArray(Item1) = FileArray(Item2)
            FileArray(Item2) = ItemTmp
          end if
        Next
    Next

    ' keep only MaxNumberBackup files : old backup are deleted
    For Item1 = MaxNumberBackup to ubound(FileArray)
        FilePath = split(FileArray(Item1),"|")(0)
        FileDate = split(FileArray(Item1),"|")(1)
        fso.DeleteFile(FilePath)
    Next


    '---------------------------------------
    ' Move and rename the log files
    '--------------------------------------- 

    ' Generate the name of the folder where NTBAckup creates logs
    NTBackupLogFolder = WshSysEnv("SYSTEMDRIVE") & "\Documents and Settings\"& WshShell.ExpandEnvironmentStrings("%USERNAME%") &"\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data"


    'Move the NTBackup logs to the Backup Folder
    If fso.FolderExists(NTBackupLogFolder) then
     Set Odir=fso.GetFolder(NTBackupLogFolder).files
     For Each oFile in Odir
     If Right(LCase(oFile.Path),3)="log" Then
     On Error Resume Next
      fso.MoveFile oFile.path , BackupFolder & "\" & "Backup" & "-" & DateFileName (oFile.DateLastModified) & ".log"
     On Error GoTo 0
     End IF
     Next
    End If

    'Delete the old Log Files
    Set Odir=fso.GetFolder(BackupFolder).files
    FileDate=0
    FileName=""
    For Each oFile in Odir
    If Right(LCase(oFile.Path),3)="log" Then
     If DateDiff("d", oFile.DateLastModified, Now) > MaxLogTime Then
      fso.DeleteFile (oFile.path)
     End If
    End If
    Next

    'Find the more recent log file
    Set Odir=fso.GetFolder(BackupFolder).files
    FileDate=0
    Latestlog=""
    For Each oFile in Odir
    If Right(LCase(oFile.Path),3)="log" Then
     If FileDate < oFile.DateLastModified Then
      FileDate=oFile.DateLastModified
      Latestlog=oFile.path
     End If
    End If
    Next


    EventType=""
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colLoggedEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent Where Logfile = 'application' and sourceName = 'NTbackup'")

    For Each objEvent in colLoggedEvents
    MailText =Left(objEvent.TimeWritten,4)&"-"&Mid(objEvent.TimeWritten,5,2)&"-"&Mid(objEvent.TimeWritten,7,2)&"-"&Mid(objEvent.TimeWritten,9,2)&"-"&Mid(objEvent.TimeWritten,11,2)
    MailText = MailText & " " & objEvent.SourceName & " ID=" & objEvent.EventCode &" " & objEvent.ComputerName
    MailText = MailText &" " & objEvent.Type &  " " & objEvent.Message
    EventType=objEvent.Type
    Exit For
    Next


    If LCase(EventType)= "error" or  LCase(EventType)="erreur" Then
     MailSubject="SystemState Error    -" & Left(objEvent.TimeWritten,4)&"/"&Mid(objEvent.TimeWritten,5,2)&"/"&Mid(objEvent.TimeWritten,7,2)&" "&Mid(objEvent.TimeWritten,9,2)&":"&Mid(objEvent.TimeWritten,11,2) &" " &objEvent.ComputerName
    ElseIf EventType="" Then
     MailText="No event found for NTBackup"
     MailSubject="SystemState Error   -" & CStr(Now) & " - " & WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
    Else
     MailText="Backup Successfull"
     MailSubject="SystemState Success -" & Left(objEvent.TimeWritten,4)&"/"&Mid(objEvent.TimeWritten,5,2)&"/"&Mid(objEvent.TimeWritten,7,2)&" "&Mid(objEvent.TimeWritten,9,2)&":"&Mid(objEvent.TimeWritten,11,2) &" " &objEvent.ComputerName
    End If


    Set drv = fso.GetDrive(fso.GetDriveName(BackupFolder))
    MailText = MailText & vbCRLF & "Backup folder: "& BackupFolder
    MailText = MailText & vbCRLF & "Drive " & fso.GetDriveName(BackupFolder)
    MailText = MailText & " Total Space: " & FormatNumber(drv.TotalSize / 1024, 0) & " Kb"
    MailText = MailText & " - Free Space: " & FormatNumber(drv.FreeSpace / 1024, 0)  & " Kb"


    Sendmail

    Function DateFileName (Mydate)
    Dim DateString
    DateString=Year(MyDate)
    If Len(Month(MyDate))=1 Then DateString=DateString & "-0" & Month(MyDate) Else DateString=DateString & "-" & Month(MyDate)
    If Len(Day(MyDate))=1 Then DateString=DateString & "-0" & Day(MyDate) Else DateString=DateString & "-" & Day(MyDate)
    If Len(Hour(MyDate))=1 Then DateString=DateString & "-0" & Hour(MyDate) Else DateString=DateString & "-" & Hour(MyDate)
    If Len(Minute(MyDate))=1 Then DateString=DateString & "-0" & Minute(MyDate) Else DateString=DateString & "-" & Minute(MyDate)
    DateFileName=DateString
    End Function

     

    Sub sendmail
        Dim iMsg
         Dim iConf
         Dim Flds
         Const cdoSendUsingPort = 2
         Const strSmartHost = "smtp.us.pasteur.aventis.com"
     
         'Create the message object.
         Set iMsg = CreateObject("CDO.Message")
     
         'Create the configuration object.
         Set iConf = iMsg.Configuration
     
         'Set the fields of the configuration object to send by using SMTP through port 25.
         With iConf.Fields
            .item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
            .item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
            .Update
         End With
     
         'Set the To, From, Subject, and Body properties of the message.
         With iMsg
            .To = "admin@seudominio.com.br"
            .From = "qualqueremailvalido@seudominio.com.br"
            .Subject = MailSubject
            .TextBody = MailText
            If Latestlog<>"" Then
            .AddAttachment Latestlog
      End If
            .Send
         End With
         set iMsg = Nothing
    End Sub

    segunda-feira, 19 de janeiro de 2009 20:06
  • Marcelo, bacana seu script mas não consegui encontrar onde esta a função que faz o agendamento de execução.
    terça-feira, 20 de janeiro de 2009 17:14
  • Eu uso o gerenciador de tarefas.

    Vc mencionou que não está confiando muito no seu...

    Mas não tem erro se fizer tudo direitinho. Vc pode usar

    também o comando AT (http://webtools.live2support.com/windows/at.php)

    Um abraço,

    Marcelo.

    terça-feira, 20 de janeiro de 2009 18:08
  • O problema esta porque ele executa alguns dias e depois para de executar.

     

    terça-feira, 20 de janeiro de 2009 18:43
  • A respeito do serviço de agendamento,

    Você já tentou desmarcar a opção: "Stop the Task if it runs for XX hours XX minutes"?

    terça-feira, 20 de janeiro de 2009 19:42
  • Code Snippet

    '-----------------------------------------------------------------------------------------
    'DelOldFiles.vbs - 4/22/2000
    '
    'Purpose: Deletes files and folders older than a given number of days (based on Last
    ' Modified Date) from a specified folder and ALL of its subdirectories.
    '
    'Prerequisites: Get WSH 2.0 at
    ' http://msdn.microsoft.com/scripting/default.htm?/scripting/windowshost/
    ' You should also run this with CSCRIPT.EXE, not wscript.exe.
    '
    'Syntax: DelOldFiles.vbs &lt;Folder&gt; &lt;no_days_old&gt;
    '
    'Example: DelOldFiles.vbs "c:\temp" 7
    ' This will delete all files in c:\temp and its subdirectories that are 7 days old
    '
    'Notes: You will have to change the logfile path and name so that you can keep track of
    ' what was deleted. You can also comment out the delete statements (there are two
    ' of them) indicated by comments below to generate the logfile without actually
    ' deleting anything so you can make sure nothing important is being deleted.
    '
    'IMPORTANT: This script deletes files PERMANENTLY so make sure you know what you're doing.
    '
    'Copyright: Steve Seguis
    ' scriptmaster@scripthorizon.com
    ' www.scripthorizon.com
    '-----------------------------------------------------------------------------------------
    '=== Force declaration of ALL variables (variants)
    Option Explicit

    '=== Variables declaration required because of Option Explicit
    Dim fso
    Dim oArgs
    Dim MyRootFolder
    Dim fsOut
    Dim logfile
    Dim outputString

    '=== CHANGE this to the path and name of the log file this script will output to.
    logfile = "DeletedFiles.log"

    '=== Constant Required for OpenTextFile function
    Const ForReading = 1
    Const ForWriting = 2
    Const ForAppending = 8

    '=== Get the command line arguments
    Set oArgs = Wscript.Arguments
    If oArgs.Count < 2 Then
    Wscript.Echo "USAGE: DelOldFiles " & "&lt;Folder&gt;" & " &lt;no_days_old&gt;"
    Wscript.Echo ""
    WScript.Echo "Example: DelOldFiles.vbs c:\temp 7"
    WScript.Echo "This will delete all files in c:\temp and its subdirectories"
    WScript.Echo "that are over 7 days old."
    Wscript.Quit 1
    End If

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyRootFolder = fso.GetFolder(oArgs(0))

    on error resume next 'fabio 21/05/2007

    '===First make sure if the folder exists
    IF NOT fso.FolderExists(MyRootFolder) Then
    fsOut.WriteLine oArgs(0) & "is not a valid Folder"
    WScript.Quit 1
    End If

    '=== Next make sure the third parameter is really a number
    If IsNumeric(oArgs(1)) Then
    If CInt(oArgs(1)) >= 0 Then
    '=== Get logfile object ready for appending
    Set fsOut = fso.OpenTextFile(logfile, ForAppending, True)
    fsOut.WriteLine now
    fsOut.WriteLine "Arquivo Ultima Modificação"
    '=== Call DeleteOldFiles on the current folder
    DeleteOldFiles MyRootFolder, oArgs(1)
    Else
    fsOut.WriteLine "The Second Parameter must a positive number"
    WScript.Quit 1
    End If
    Else
    fsOut.WriteLine "The Second Parameter must a positive number"
    WScript.Quit 1
    End If

    '=== Close logfile and quit
    fsOut.Close
    'WScript.Echo "Script Complete!"
    WScript.Quit 0


    '------------------------------------------------------------------------------------------
    'DeleteOldFiles(Folder,noDays)
    '
    'Purpose: Deletes files and subfolders in Folder that are noDays old.
    '------------------------------------------------------------------------------------------
    Sub DeleteOldFiles(Folder,noDays)
    '=== Varibles with local scope as we will this sub procedure recursively
    Dim Datedifference
    Dim MySubFolders
    Dim MyFiles
    Dim MyFile
    Dim MyFolder

    '=== Get the collection of Folders in this folder
    Set MySubFolders = Folder.SubFolders

    '=== Get the collection of Files in this folder
    Set MyFiles = Folder.files

    '=== If there are subfolders, let process them first.
    IF MySubFolders.Count <> 0 Then
    For each MyFolder in MySubFolders
    DeleteOldFiles MyFolder, noDays
    'Se a pasta estiver vazia delete
    if Myfolder.files.count + Myfolder.SubFolders.count = 0 then
    MyFolder.Delete
    end if
    Next
    End If

    '=== If this folder isn't emtpy, process each file to see if they are older than
    ' the maximum age limit (noDays).
    IF MyFiles.Count <> 0 Then
    For Each MyFile in MyFiles
    '=== Find out how old the file is compared to current date
    Datedifference = DateDiff("D",MyFile.DateLastModified,Date)
    IF (Datedifference >= CInt(noDays)) Then
    '=== This file is old, delete and add entry to logfile
    outputString = MyFile.path & vbtab & MyFile.DateLastModified
    'WScript.Echo outputString
    fsOut.WriteLine outputString
    '=== If you just want to do a dry run of this script, comment out
    ' the next line to prevent the file from being deleted. The true
    ' after the delete statement is necessary to force delete
    MyFile.delete true
    Else
    'Wscript.Echo MyFile.path & " is OK!"
    End If
    Next
    End If

    '=== If this folder is emtpy, meaning no subfolders or files, check if this folder
    ' is older than maximum age limit and delete accordingly
    If MySubFolders.Count = 0 And MyFiles.Count = 0 Then
    Datedifference = DateDiff("D",Folder.DateLastModified,Date)
    IF (Datedifference > CInt(noDays)) Then
    '=== This Folder is old, delete and add entry to logfile
    outputString = Folder.path & vbtab & Folder.DateLastModified
    'WScript.Echo outputString
    fsOut.WriteLine outputString
    '=== If you just want to do a dry run of this script, comment out
    ' the next line to prevent the file from being deleted. The true
    ' after the delete statement is necessary to force delete
    Folder.delete true
    Exit Sub
    Else
    'Wscript.Echo Folder.path & " is OK!"
    End If
    End If

    End Sub
    '------------------------------------------------------------------------------------------
    'End of DeleteOldFiles
    '------------------------------------------------------------------------------------------


    quarta-feira, 21 de janeiro de 2009 11:44
  • Code Snippet

    '-----------------------------------------------------------------------------------------
    'DelOldFiles.vbs - 4/22/2000
    '
    'Purpose: Deletes files and folders older than a given number of days (based on Last
    ' Modified Date) from a specified folder and ALL of its subdirectories.
    '
    'Prerequisites: Get WSH 2.0 at
    ' http://msdn.microsoft.com/scripting/default.htm?/scripting/windowshost/
    ' You should also run this with CSCRIPT.EXE, not wscript.exe.
    '
    'Syntax: DelOldFiles.vbs &lt;Folder&gt; &lt;no_days_old&gt;
    '
    'Example: DelOldFiles.vbs "c:\temp" 7
    ' This will delete all files in c:\temp and its subdirectories that are 7 days old
    '
    'Notes: You will have to change the logfile path and name so that you can keep track of
    ' what was deleted. You can also comment out the delete statements (there are two
    ' of them) indicated by comments below to generate the logfile without actually
    ' deleting anything so you can make sure nothing important is being deleted.
    '
    'IMPORTANT: This script deletes files PERMANENTLY so make sure you know what you're doing.
    '
    'Copyright: Steve Seguis
    ' scriptmaster@scripthorizon.com
    ' www.scripthorizon.com
    '-----------------------------------------------------------------------------------------
    '=== Force declaration of ALL variables (variants)
    Option Explicit

    '=== Variables declaration required because of Option Explicit
    Dim fso
    Dim oArgs
    Dim MyRootFolder
    Dim fsOut
    Dim logfile
    Dim outputString

    '=== CHANGE this to the path and name of the log file this script will output to.
    logfile = "DeletedFiles.log"

    '=== Constant Required for OpenTextFile function
    Const ForReading = 1
    Const ForWriting = 2
    Const ForAppending = 8

    '=== Get the command line arguments
    Set oArgs = Wscript.Arguments
    If oArgs.Count < 2 Then
    Wscript.Echo "USAGE: DelOldFiles " & "&lt;Folder&gt;" & " &lt;no_days_old&gt;"
    Wscript.Echo ""
    WScript.Echo "Example: DelOldFiles.vbs c:\temp 7"
    WScript.Echo "This will delete all files in c:\temp and its subdirectories"
    WScript.Echo "that are over 7 days old."
    Wscript.Quit 1
    End If

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyRootFolder = fso.GetFolder(oArgs(0))

    on error resume next 'fabio 21/05/2007

    '===First make sure if the folder exists
    IF NOT fso.FolderExists(MyRootFolder) Then
    fsOut.WriteLine oArgs(0) & "is not a valid Folder"
    WScript.Quit 1
    End If

    '=== Next make sure the third parameter is really a number
    If IsNumeric(oArgs(1)) Then
    If CInt(oArgs(1)) >= 0 Then
    '=== Get logfile object ready for appending
    Set fsOut = fso.OpenTextFile(logfile, ForAppending, True)
    fsOut.WriteLine now
    fsOut.WriteLine "Arquivo Ultima Modificação"
    '=== Call DeleteOldFiles on the current folder
    DeleteOldFiles MyRootFolder, oArgs(1)
    Else
    fsOut.WriteLine "The Second Parameter must a positive number"
    WScript.Quit 1
    End If
    Else
    fsOut.WriteLine "The Second Parameter must a positive number"
    WScript.Quit 1
    End If

    '=== Close logfile and quit
    fsOut.Close
    'WScript.Echo "Script Complete!"
    WScript.Quit 0


    '------------------------------------------------------------------------------------------
    'DeleteOldFiles(Folder,noDays)
    '
    'Purpose: Deletes files and subfolders in Folder that are noDays old.
    '------------------------------------------------------------------------------------------
    Sub DeleteOldFiles(Folder,noDays)
    '=== Varibles with local scope as we will this sub procedure recursively
    Dim Datedifference
    Dim MySubFolders
    Dim MyFiles
    Dim MyFile
    Dim MyFolder

    '=== Get the collection of Folders in this folder
    Set MySubFolders = Folder.SubFolders

    '=== Get the collection of Files in this folder
    Set MyFiles = Folder.files

    '=== If there are subfolders, let process them first.
    IF MySubFolders.Count <> 0 Then
    For each MyFolder in MySubFolders
    DeleteOldFiles MyFolder, noDays
    'Se a pasta estiver vazia delete
    if Myfolder.files.count + Myfolder.SubFolders.count = 0 then
    MyFolder.Delete
    end if
    Next
    End If

    '=== If this folder isn't emtpy, process each file to see if they are older than
    ' the maximum age limit (noDays).
    IF MyFiles.Count <> 0 Then
    For Each MyFile in MyFiles
    '=== Find out how old the file is compared to current date
    Datedifference = DateDiff("D",MyFile.DateLastModified,Date)
    IF (Datedifference >= CInt(noDays)) Then
    '=== This file is old, delete and add entry to logfile
    outputString = MyFile.path & vbtab & MyFile.DateLastModified
    'WScript.Echo outputString
    fsOut.WriteLine outputString
    '=== If you just want to do a dry run of this script, comment out
    ' the next line to prevent the file from being deleted. The true
    ' after the delete statement is necessary to force delete
    MyFile.delete true
    Else
    'Wscript.Echo MyFile.path & " is OK!"
    End If
    Next
    End If

    '=== If this folder is emtpy, meaning no subfolders or files, check if this folder
    ' is older than maximum age limit and delete accordingly
    If MySubFolders.Count = 0 And MyFiles.Count = 0 Then
    Datedifference = DateDiff("D",Folder.DateLastModified,Date)
    IF (Datedifference > CInt(noDays)) Then
    '=== This Folder is old, delete and add entry to logfile
    outputString = Folder.path & vbtab & Folder.DateLastModified
    'WScript.Echo outputString
    fsOut.WriteLine outputString
    '=== If you just want to do a dry run of this script, comment out
    ' the next line to prevent the file from being deleted. The true
    ' after the delete statement is necessary to force delete
    Folder.delete true
    Exit Sub
    Else
    'Wscript.Echo Folder.path & " is OK!"
    End If
    End If

    End Sub
    '------------------------------------------------------------------------------------------
    'End of DeleteOldFiles
    '------------------------------------------------------------------------------------------


    quarta-feira, 21 de janeiro de 2009 11:44
  • Boa!!!

    Estava marcado para interromper apos 72 horas.

     

    quarta-feira, 28 de janeiro de 2009 14:10