Solved

Please change this script so it backups up sub folder by the mod date and its contents.

Posted on 2013-10-31
19
414 Views
Last Modified: 2013-11-18
Hi,

Can someone modify this code so I can backup the subfolders. I am not sure how to modify it to get it to work.


srcDir="C:\Test1"
destDir="C:\Test2"
If Right(srcdir, 1) <> "\" Then srcdir = srcdir & "\"
If Right(destdir, 1) <> "\" Then destdir = destdir & "\"

Set fso=CreateObject("Scripting.FileSystemObject")
Set sh=WScript.CreateObject("WScript.Shell")

FileSet = GetDirContents(srcDir)
intFile = 0
intFiles = ubound(fileset) + 1
Dim objDoc 'Required global declaration for status bar document
Dim objIE 'Required global declaration for Internet Explorer object


strTitle = "Status-Bar"

For each File in FileSet
      intfile = intfile + 1
      x = cint(intfile / intfiles * 100)
      msg = "File " & intfile & " of " & intFiles & vbCrLf
      Set File = fso.GetFile(srcdir & File)
      statusBar x, msg
      WScript.Sleep 10
       Date1 = File.DateLastModified
      Date2 = Now()
      'DDiff = Abs(DateDiff("h", Date1, Date2))
      DDiff = Abs(DateDiff("d", Date1, Date2))

    If DDiff >= 60 Then
      If Not fso.FileExists(DestPath & File.Name) Then
        File.Move DestDir
                'wscript.echo File.Name
      Else
        wscript.echo "Unable to move file [" & File.Name & "].  A file by this name already exists in the target directory."
      End If
    End If
Next

WScript.Sleep 1000
statusBar -1, ""
Set objDoc = Nothing
Set objIE = Nothing
MsgBox "File move complete"


Function statusBar(intPercent, strTitle)
'intPercent is limited to the range 0 ... 100.
'If intPercent is out of range, then the window is suppressed for those values

      'Create the status bar window
          on Error resume next
        If objDoc Is Nothing Then
                  If ((Cint(intPercent) >= 0) And (Cint(intPercent) <= 100)) Then
                        Set objIE = CreateObject("InternetExplorer.Application")
                        objIE.Offline = True
                        objIE.AddressBar = False
                        objIE.MenuBar = False
                        objIE.StatusBar = False
                        objIE.Silent = false 'True
                        objIE.ToolBar = False
                        objIE.Navigate "about:blank"
                        Do While objIE.Busy
                              WScript.Sleep 100
                        Loop
                        'On Error Resume Next
                        Set objDoc = Nothing
                        Do Until Not objDoc Is Nothing
                              WScript.Sleep 100
                              Set objDoc = objIE.Document
                        Loop
                        objDoc.Open
                        objDoc.Write "<html><head><title>" & strTitle & "</title></head>"
                        objDoc.Write "<body><center>"
                      objDoc.Write "<TABLE width=200 border=3 >"
                      objDoc.Write "<tr><td>"
                      objDoc.Write "<TABLE id=status width=0 border=0 cellpadding=0 cellspacing=0 bgcolor=#FFFFFF>"
                      objDoc.Write "<tr><td>&nbsp</td></tr>"
                      objDoc.Write "</table>"
                  objDoc.Write "</td></tr>"
                objDoc.Write "</TABLE>"
                        objDoc.Write "</body>"
                  objDoc.Write "</html>"
                    objDoc.Close
                        With objIE.Document.ParentWindow.Screen
                              objIE.Width = 200
                              objIE.Height = 50
                            objIE.Left = (.AvailWidth  - objIE.Width ) \ 2
                            objIE.Top  = (.Availheight - objIE.Height) \ 2
                        End With
                    objIE.Visible = True
                  Else
                        Exit Function
                  End If
            Else
              objDoc.Title = strTitle
            End If

      'Close the status bar window
      If Not objDoc Is Nothing Then
            If ((Cint(intPercent) < 0) Or (Cint(intPercent) > 100)) Then
                  objIE.Visible = False
                  Set objDoc = Nothing
                  objIE.Quit
                  Set objIE = Nothing
                  Exit Function
            End If
      End If

      'Update the status bar window
      If Cint(intPercent) = 0 Then
            objDoc.all.status.width = "0%"
            objDoc.all.status.bgcolor = "#FFFFFF"
      Else
            objDoc.all.status.width = Cstr(Cint(intPercent)) & "%"
            objDoc.all.status.bgcolor = "#00CCFF"
      End If

'    for each ie in createobject("shell.application").windows
'        if instr(lcase(typename(ie.document)),"htmldocument") <> 0 then
'            if ie.document.title = strTitle then
'                ie.visible = true
'                .appactivate ie
'            end if
'        end if
'    next

End Function




Function GetDirContents(FolderPath)
 Dim  FileCollection, aTmp(), i
 Set fso = CreateObject("Scripting.FileSystemObject")
 Set FileCollection = fso.GetFolder(FolderPath).Files

  Redim aTmp(FileCollection.count - 1)
  i = -1

    For Each File in FileCollection
       i = i + 1
       aTmp(i) = File.Name
    Next

  GetDirContents = aTmp
End Function
0
Comment
Question by:Vicki05
  • 10
  • 9
19 Comments
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
srcDir = "C:\Test1"
DestDir = "C:\Test2"
If Right(srcDir, 1) <> "\" Then srcDir = srcDir & "\"
If Right(DestDir, 1) <> "\" Then DestDir = DestDir & "\"

Set fso = CreateObject("Scripting.FileSystemObject")
Set sh = WScript.CreateObject("WScript.Shell")

'Getting the Folder Object
Set ObjFolder = fso.GetFolder(srcDir)
    
'Getting the list of SubFolders
Set ObjSubFolders = ObjFolder.SubFolders
    
FolderSet = GetDirContents(srcDir)
intFolder = 0
intFolders = UBound(FolderSet) + 1
Dim objDoc    'Required global declaration for status bar document
Dim objIE    'Required global declaration for Internet Explorer object

strTitle = "Status-Bar"

For Each ObjSubFolder In ObjSubFolders
    intFolder = intFolder + 1
    x = CInt(intFolder / intFolders * 100)
    msg = "Folder " & intFolder & " of " & intFolders & vbCrLf
'     Set File = fso.GetFile(srcDir & File)
    statusBar x, msg
    WScript.Sleep 10
    Date1 = ObjSubFolder.DateLastModified
    Date2 = Now()
    'DDiff = Abs(DateDiff("h", Date1, Date2))
    DDiff = Abs(DateDiff("d", Date1, Date2))

    If DDiff >= 40 Then
        If Not fso.FolderExists(DestPath & ObjSubFolder.Name) Then
            ObjSubFolder.Move DestDir
            'wscript.echo File.Name
        Else
            WScript.Echo "Unable to move folder [" & ObjSubFolder.Name & "].  A folder by this name already exists in the target directory."
        End If
    End If
Next

WScript.Sleep 1000
statusBar -1, ""
Set objDoc = Nothing
Set objIE = Nothing
MsgBox "Folder move complete"

Function statusBar(intPercent, strTitle)
'intPercent is limited to the range 0 ... 100.
'If intPercent is out of range, then the window is suppressed for those values

'Create the status bar window
    On Error Resume Next
    If objDoc Is Nothing Then
        If ((CInt(intPercent) >= 0) And (CInt(intPercent) <= 100)) Then
            Set objIE = CreateObject("InternetExplorer.Application")
            objIE.Offline = True
            objIE.AddressBar = False
            objIE.MenuBar = False
            objIE.statusBar = False
            objIE.Silent = False    'True
            objIE.Toolbar = False
            objIE.Navigate "about:blank"
            Do While objIE.Busy
                WScript.Sleep 100
            Loop
            'On Error Resume Next
            Set objDoc = Nothing
            Do Until Not objDoc Is Nothing
                WScript.Sleep 100
                Set objDoc = objIE.Document
            Loop
            objDoc.Open
            objDoc.Write "<html><head><title>" & strTitle & "</title></head>"
            objDoc.Write "<body><center>"
            objDoc.Write "<TABLE width=200 border=3 >"
            objDoc.Write "<tr><td>"
            objDoc.Write "<TABLE id=status width=0 border=0 cellpadding=0 cellspacing=0 bgcolor=#FFFFFF>"
            objDoc.Write "<tr><td>&nbsp</td></tr>"
            objDoc.Write "</table>"
            objDoc.Write "</td></tr>"
            objDoc.Write "</TABLE>"
            objDoc.Write "</body>"
            objDoc.Write "</html>"
            objDoc.Close
            With objIE.Document.ParentWindow.Screen
                objIE.Width = 200
                objIE.Height = 50
                objIE.Left = (.AvailWidth - objIE.Width) \ 2
                objIE.Top = (.Availheight - objIE.Height) \ 2
            End With
            objIE.Visible = True
        Else
            Exit Function
        End If
    Else
        objDoc.Title = strTitle
    End If

    'Close the status bar window
    If Not objDoc Is Nothing Then
        If ((CInt(intPercent) < 0) Or (CInt(intPercent) > 100)) Then
            objIE.Visible = False
            Set objDoc = Nothing
            objIE.Quit
            Set objIE = Nothing
            Exit Function
        End If
    End If

    'Update the status bar window
    If CInt(intPercent) = 0 Then
        objDoc.all.status.Width = "0%"
        objDoc.all.status.bgcolor = "#FFFFFF"
    Else
        objDoc.all.status.Width = CStr(CInt(intPercent)) & "%"
        objDoc.all.status.bgcolor = "#00CCFF"
    End If

    '    for each ie in createobject("shell.application").windows
    '        if instr(lcase(typename(ie.document)),"htmldocument") <> 0 then
    '            if ie.document.title = strTitle then
    '                ie.visible = true
    '                .appactivate ie
    '            end if
    '        end if
    '    next

End Function

Function GetDirContents(FolderPath)
    Dim FolderCollection, aTmp(), i
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderCollection = fso.GetFolder(FolderPath).SubFolders

    ReDim aTmp(FolderCollection.Count - 1)
    i = -1

    For Each Folder In FolderCollection
        i = i + 1
        aTmp(i) = Folder.Name
    Next

    GetDirContents = aTmp
End Function

Open in new window

0
 

Author Comment

by:Vicki05
Comment Utility
I am getting Permission Denied error

Line 37
Char 13
code 800a0046
0
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
Check permissions of both source and destination folders.
0
 

Author Comment

by:Vicki05
Comment Utility
Will test on another computer.
0
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
Ok, thanks for the update.

You have, as I see it, two options:
1. Add the following to the beginning of the script and see if it helps.
Dim OSList, OS, UAC
UAC = False
If WScript.Arguments.Count >= 1 Then
    If WScript.Arguments.Item(0) = "elevated" Then UAC = True
End If

If Not(UAC) Then
    Set OSList = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
    For Each OS In OSList
        If InStr(1, OS.Caption, "XP") = 0 And InStr(1, OS.Caption, "Server 2003") = 0 Then
            CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ elevated" , "", "runas", 1
            WScript.Quit
        End If
    Next
End If

Open in new window

2. or you can take ownership on the folders, and make sure you've got the right permissions. Here you will find a nice tutorial.
0
 

Author Comment

by:Vicki05
Comment Utility
Hi,

The script seems to work, but if when I am trying to use it to move files and backup folder, it skips the move files. Would you know what might cause that? It totally skips this following part of the script and jumps directly to your modified script. Is it possible to modify the script you provided to also look for files in the root folder as well?

srcDir="C:\Test1"
destDir="C:\Test2"
If Right(srcdir, 1) <> "\" Then srcdir = srcdir & "\"
If Right(destdir, 1) <> "\" Then destdir = destdir & "\"

Set fso=CreateObject("Scripting.FileSystemObject")
Set sh=WScript.CreateObject("WScript.Shell")

FileSet = GetDirContents(srcDir)
intFile = 0
intFiles = ubound(fileset) + 1
Dim objDoc 'Required global declaration for status bar document
Dim objIE 'Required global declaration for Internet Explorer object


strTitle = "Status-Bar"

For each File in FileSet
      intfile = intfile + 1
      x = cint(intfile / intfiles * 100)
      msg = "File " & intfile & " of " & intFiles & vbCrLf
      Set File = fso.GetFile(srcdir & File)
      statusBar x, msg
      WScript.Sleep 10
       Date1 = File.DateLastModified
      Date2 = Now()
      'DDiff = Abs(DateDiff("h", Date1, Date2))
      DDiff = Abs(DateDiff("d", Date1, Date2))

    If DDiff >= 60 Then
      If Not fso.FileExists(DestPath & File.Name) Then
        File.Move DestDir
                'wscript.echo File.Name
      Else
        wscript.echo "Unable to move file [" & File.Name & "].  A file by this name already exists in the target directory."
      End If
    End If
Next

WScript.Sleep 1000
statusBar -1, ""
Set objDoc = Nothing
Set objIE = Nothing
MsgBox "File move complete"


Function statusBar(intPercent, strTitle)
'intPercent is limited to the range 0 ... 100.
'If intPercent is out of range, then the window is suppressed for those values

      'Create the status bar window
          on Error resume next
        If objDoc Is Nothing Then
                  If ((Cint(intPercent) >= 0) And (Cint(intPercent) <= 100)) Then
                        Set objIE = CreateObject("InternetExplorer.Application")
                        objIE.Offline = True
                        objIE.AddressBar = False
                        objIE.MenuBar = False
                        objIE.StatusBar = False
                        objIE.Silent = false 'True
                        objIE.ToolBar = False
                        objIE.Navigate "about:blank"
                        Do While objIE.Busy
                              WScript.Sleep 100
                        Loop
                        'On Error Resume Next
                        Set objDoc = Nothing
                        Do Until Not objDoc Is Nothing
                              WScript.Sleep 100
                              Set objDoc = objIE.Document
                        Loop
                        objDoc.Open
                        objDoc.Write "<html><head><title>" & strTitle & "</title></head>"
                        objDoc.Write "<body><center>"
                      objDoc.Write "<TABLE width=200 border=3 >"
                      objDoc.Write "<tr><td>"
                      objDoc.Write "<TABLE id=status width=0 border=0 cellpadding=0 cellspacing=0 bgcolor=#FFFFFF>"
                      objDoc.Write "<tr><td>&nbsp</td></tr>"
                      objDoc.Write "</table>"
                  objDoc.Write "</td></tr>"
                objDoc.Write "</TABLE>"
                        objDoc.Write "</body>"
                  objDoc.Write "</html>"
                    objDoc.Close
                        With objIE.Document.ParentWindow.Screen
                              objIE.Width = 200
                              objIE.Height = 50
                            objIE.Left = (.AvailWidth  - objIE.Width ) \ 2
                            objIE.Top  = (.Availheight - objIE.Height) \ 2
                        End With
                    objIE.Visible = True
                  Else
                        Exit Function
                  End If
            Else
              objDoc.Title = strTitle
            End If

      'Close the status bar window
      If Not objDoc Is Nothing Then
            If ((Cint(intPercent) < 0) Or (Cint(intPercent) > 100)) Then
                  objIE.Visible = False
                  Set objDoc = Nothing
                  objIE.Quit
                  Set objIE = Nothing
                  Exit Function
            End If
      End If

      'Update the status bar window
      If Cint(intPercent) = 0 Then
            objDoc.all.status.width = "0%"
            objDoc.all.status.bgcolor = "#FFFFFF"
      Else
            objDoc.all.status.width = Cstr(Cint(intPercent)) & "%"
            objDoc.all.status.bgcolor = "#00CCFF"
      End If

'    for each ie in createobject("shell.application").windows
'        if instr(lcase(typename(ie.document)),"htmldocument") <> 0 then
'            if ie.document.title = strTitle then
'                ie.visible = true
'                .appactivate ie
'            end if
'        end if
'    next

End Function




Function GetDirContents(FolderPath)
 Dim  FileCollection, aTmp(), i
 Set fso = CreateObject("Scripting.FileSystemObject")
 Set FileCollection = fso.GetFolder(FolderPath).Files

  Redim aTmp(FileCollection.count - 1)
  i = -1

    For Each File in FileCollection
       i = i + 1
       aTmp(i) = File.Name
    Next

  GetDirContents = aTmp
End Function
0
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
Please provide the full script you are using.
0
 

Author Comment

by:Vicki05
Comment Utility
Hi MacroShadow,

Here is the script. I am using the script I provided earlier to clean the files in the folder. The one you provided is being used to clear the folder. With both in the same vbs file, it skips moving the files. Is it possilbe to have both options in your script? if there is files and folders in the same folder to move both?

intAnswer = _
    Msgbox("This Utility is Designed to Clean System old Data Files. Would you like to continue?", _
        vbYesNo, "Run Program")

If intAnswer = vbNo Then
    Msgbox "You answered No. Click OK to exit"
Wscript.Quit
End If
'Else
If intAnswer = vbYes Then
On Error Resume Next

dim filesys, newfolder
set filesys=CreateObject("Scripting.FileSystemObject")
If  Not filesys.FolderExists("C:\System_CleanUp\") Then
   newfolder = filesys.CreateFolder ("C:\System_CleanUp\")
   'Response.Write "A new folder '" & newfolder & "' has been created"
End If
If  Not filesys.FolderExists("C:\System_CleanUp\XAVIER\") Then
   newfolder = filesys.CreateFolder ("C:\System_CleanUp\XAVIER\")
   'Response.Write "A new folder '" & newfolder & "' has been created"
End If
If  Not filesys.FolderExists("C:\System_CleanUp\XAVIER\Archive\") Then
   newfolder = filesys.CreateFolder ("C:\System_CleanUp\XAVIER\Archive\")
   'Response.Write "A new folder '" & newfolder & "' has been created"
End If

If  Not filesys.FolderExists("C:\System_CleanUp\XAVIER\Folder1\") Then
   newfolder = filesys.CreateFolder ("C:\System_CleanUp\XAVIER\Folder1\")
   'Response.Write "A new folder '" & newfolder & "' has been created"
End If

'Option Explicit

'On Error Resume Next

Dim fso, FileSet, Path, File, DDiff, Date1, Date2, DestPath

'------------------------------------------------------------------------------------------
'C:\XAVIER\Archive

srcDir="C:\XAVIER\Archive\"
destDir="C:\System_CleanUp\XAVIER\Archive\"
If Right(srcdir, 1) <> "\" Then srcdir = srcdir & "\"
If Right(destdir, 1) <> "\" Then destdir = destdir & "\"

Set fso=CreateObject("Scripting.FileSystemObject")
Set sh=WScript.CreateObject("WScript.Shell")

FileSet = GetDirContents(srcDir)
intFile = 0
intFiles = ubound(fileset) + 1
Dim objDoc 'Required global declaration for status bar document
Dim objIE 'Required global declaration for Internet Explorer object

strComputer = "."
Set objWMIService = GetObject("Winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
For Each objItem in colItems
    intHorizontal = objItem.ScreenWidth
    intVertical = objItem.ScreenHeight
'wscript.echo inthorizontal & " : " & intvertical
Next


strTitle = "Status-Bar"

For each File in FileSet
      intfile = intfile + 1
      x = cint(intfile / intfiles * 100)
      msg = "File " & intfile & " of " & intFiles & vbCrLf
      Set File = fso.GetFile(srcdir & File)
      statusBar x, msg
      WScript.Sleep 10
       Date1 = File.DateLastModified
      Date2 = Now()
      'DDiff = Abs(DateDiff("h", Date1, Date2))
      DDiff = Abs(DateDiff("d", Date1, Date2))

    If DDiff >= 61 Then
      If Not fso.FileExists(DestPath & File.Name) Then
        File.Move DestDir
                'wscript.echo File.Name
      Else
        wscript.echo "Unable to move file [" & File.Name & "].  A file by this name already exists in the target directory."
      End If
    End If
Next

WScript.Sleep 1000
statusBar -1, ""
Set objDoc = Nothing
Set objIE = Nothing
'MsgBox "File move complete"


Function statusBar(intPercent, strTitle)
'intPercent is limited to the range 0 ... 100.
'If intPercent is out of range, then the window is suppressed for those values

      'Create the status bar window
          on Error resume next
            If objDoc Is Nothing Then
            If ((Cint(intPercent) >= 0) And (Cint(intPercent) <= 100)) Then
                  Set objIE = CreateObject("InternetExplorer.Application")
                  objIE.Offline = True
                  objIE.AddressBar = False
                  objIE.Height = 100
                        objIE.top = cint((intvertical - objie.height)/2)
                  objIE.width = 250
                        objIE.left = cint((inthorizontal - objie.width)/2)
                  objIE.Width = 250
                        objIE.left = 300
                  objIE.MenuBar = False
                  objIE.StatusBar = False
                  objIE.Silent = false 'True
                  objIE.ToolBar = False
                  objIE.Navigate "about:blank"
                  Do While objIE.Busy
                        WScript.Sleep 100
                  Loop
                  'On Error Resume Next
                  Set objDoc = Nothing
                  Do Until Not objDoc Is Nothing
                        WScript.Sleep 100
                        Set objDoc = objIE.Document
                  Loop
                  objDoc.Open
                  objDoc.Write "<html><head><title>" & strTitle & "</title></head>"
                    objDoc.Write "<body><center>"
                      objDoc.Write "<TABLE width=200 border=3 >"
                        objDoc.Write "<tr><td>"
                          objDoc.Write "<TABLE id=status width=0 border=0 cellpadding=0 cellspacing=0 bgcolor=#FFFFFF>"
                            objDoc.Write "<tr><td>&nbsp</td></tr>"
                          objDoc.Write "</table>"
                            objDoc.Write "</td></tr>"
                            objDoc.Write "</TABLE>"
                  objDoc.Write "</body>"
                      objDoc.Write "</html>"
                    objDoc.Close
                    objIE.Visible = True
            Else
                  Exit Function
            End If
      End If

      'Close the status bar window
      If Not objDoc Is Nothing Then
            If ((Cint(intPercent) < 0) Or (Cint(intPercent) > 100)) Then
                  objIE.Visible = False
                  Set objDoc = Nothing
                  objIE.Quit
                  Set objIE = Nothing
                  Exit Function
            End If
      End If

      'Update the status bar window
      If Cint(intPercent) = 0 Then
            objDoc.all.status.width = "0%"
            objDoc.all.status.bgcolor = "#FFFFFF"
      Else
            objDoc.all.status.width = Cstr(Cint(intPercent)) & "%"
            objDoc.all.status.bgcolor = "#00CCFF"
      End If

'    for each ie in createobject("shell.application").windows
'        if instr(lcase(typename(ie.document)),"htmldocument") <> 0 then
'            if ie.document.title = strTitle then
'                ie.visible = true
'                .appactivate ie
'            end if
'        end if
'    next

End Function




Function GetDirContents(FolderPath)
 Dim  FileCollection, aTmp(), i
 Set fso = CreateObject("Scripting.FileSystemObject")
 Set FileCollection = fso.GetFolder(FolderPath).Files

  Redim aTmp(FileCollection.count - 1)
  i = -1

    For Each File in FileCollection
       i = i + 1
       aTmp(i) = File.Name
    Next

  GetDirContents = aTmp
End Function



'-----------------------------------------------------------------------------------------------------------------------
'XAVIER\Folder1

srcDir = "C:\XAVIER\Folder1\"
DestDir = "C:\System_CleanUp\XAVIER\Folder1\"
If Right(srcDir, 1) <> "\" Then srcDir = srcDir & "\"
If Right(DestDir, 1) <> "\" Then DestDir = DestDir & "\"

Set fso = CreateObject("Scripting.FileSystemObject")
Set sh = WScript.CreateObject("WScript.Shell")

'Getting the Folder Object
Set ObjFolder = fso.GetFolder(srcDir)
   
'Getting the list of SubFolders
Set ObjSubFolders = ObjFolder.SubFolders
   
FolderSet = GetDirContents(srcDir)
intFolder = 0
intFolders = UBound(FolderSet) + 1
'Dim objDoc    'Required global declaration for status bar document
'Dim objIE    'Required global declaration for Internet Explorer object

strTitle = "Status-Bar"

For Each ObjSubFolder In ObjSubFolders
    intFolder = intFolder + 1
    x = CInt(intFolder / intFolders * 100)
    msg = "Folder " & intFolder & " of " & intFolders & vbCrLf
'     Set File = fso.GetFile(srcDir & File)
    statusBar x, msg
    WScript.Sleep 10
    Date1 = ObjSubFolder.DateLastModified
    Date2 = Now()
    'DDiff = Abs(DateDiff("h", Date1, Date2))
    DDiff = Abs(DateDiff("d", Date1, Date2))

    If DDiff >= 40 Then
        If Not fso.FolderExists(DestPath & ObjSubFolder.Name) Then
            ObjSubFolder.Move DestDir
            'wscript.echo File.Name
        Else
            WScript.Echo "Unable to move folder [" & ObjSubFolder.Name & "].  A folder by this name already exists in the target directory."
        End If
    End If
Next

WScript.Sleep 1000
statusBar -1, ""
Set objDoc = Nothing
Set objIE = Nothing
MsgBox "Folder move complete"

Function statusBar(intPercent, strTitle)
'intPercent is limited to the range 0 ... 100.
'If intPercent is out of range, then the window is suppressed for those values

'Create the status bar window
    On Error Resume Next
    If objDoc Is Nothing Then
        If ((CInt(intPercent) >= 0) And (CInt(intPercent) <= 100)) Then
            Set objIE = CreateObject("InternetExplorer.Application")
            objIE.Offline = True
            objIE.AddressBar = False
            objIE.MenuBar = False
            objIE.statusBar = False
            objIE.Silent = False    'True
            objIE.Toolbar = False
            objIE.Navigate "about:blank"
            Do While objIE.Busy
                WScript.Sleep 100
            Loop
            'On Error Resume Next
            Set objDoc = Nothing
            Do Until Not objDoc Is Nothing
                WScript.Sleep 100
                Set objDoc = objIE.Document
            Loop
            objDoc.Open
            objDoc.Write "<html><head><title>" & strTitle & "</title></head>"
            objDoc.Write "<body><center>"
            objDoc.Write "<TABLE width=200 border=3 >"
            objDoc.Write "<tr><td>"
            objDoc.Write "<TABLE id=status width=0 border=0 cellpadding=0 cellspacing=0 bgcolor=#FFFFFF>"
            objDoc.Write "<tr><td>&nbsp</td></tr>"
            objDoc.Write "</table>"
            objDoc.Write "</td></tr>"
            objDoc.Write "</TABLE>"
            objDoc.Write "</body>"
            objDoc.Write "</html>"
            objDoc.Close
            With objIE.Document.ParentWindow.Screen
                objIE.Width = 200
                objIE.Height = 50
                objIE.Left = (.AvailWidth - objIE.Width) \ 2
                objIE.Top = (.Availheight - objIE.Height) \ 2
            End With
            objIE.Visible = True
        Else
            Exit Function
        End If
    Else
        objDoc.Title = strTitle
    End If

    'Close the status bar window
    If Not objDoc Is Nothing Then
        If ((CInt(intPercent) < 0) Or (CInt(intPercent) > 100)) Then
            objIE.Visible = False
            Set objDoc = Nothing
            objIE.Quit
            Set objIE = Nothing
            Exit Function
        End If
    End If

    'Update the status bar window
    If CInt(intPercent) = 0 Then
        objDoc.all.status.Width = "0%"
        objDoc.all.status.bgcolor = "#FFFFFF"
    Else
        objDoc.all.status.Width = CStr(CInt(intPercent)) & "%"
        objDoc.all.status.bgcolor = "#00CCFF"
    End If

    '    for each ie in createobject("shell.application").windows
    '        if instr(lcase(typename(ie.document)),"htmldocument") <> 0 then
    '            if ie.document.title = strTitle then
    '                ie.visible = true
    '                .appactivate ie
    '            end if
    '        end if
    '    next

End Function

Function GetDirContents(FolderPath)
    Dim FolderCollection, aTmp(), i
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderCollection = fso.GetFolder(FolderPath).SubFolders

    ReDim aTmp(FolderCollection.Count - 1)
    i = -1

    For Each Folder In FolderCollection
        i = i + 1
        aTmp(i) = Folder.Name
    Next

    GetDirContents = aTmp
End Function


msgbox "System Cleanup Complete"
wscript.quit

End IF
0
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
Try this:

Option Explicit

Dim filesys, newfolder
Dim fso, FileSet, Path, File, DDiff, Date1, Date2, DestPath
Dim objDoc    'Required global declaration for status bar document
Dim objIE    'Required global declaration for Internet Explorer object

intAnswer = MsgBox("This Utility is Designed to Clean System old Data Files. Would you like to continue?", vbYesNo, "Run Program")

If intAnswer = vbNo Then
    MsgBox "You answered No. Click OK to exit"
    wscript.Quit
End If

If intAnswer = vbYes Then
    On Error Resume Next

    Set filesys = CreateObject("Scripting.FileSystemObject")
    If Not filesys.FolderExists("C:\System_CleanUp\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If
    If Not filesys.FolderExists("C:\System_CleanUp\XAVIER\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\XAVIER\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If
    If Not filesys.FolderExists("C:\System_CleanUp\XAVIER\Archive\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\XAVIER\Archive\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If

    If Not filesys.FolderExists("C:\System_CleanUp\XAVIER\Folder1\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\XAVIER\Folder1\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If

    '------------------------------------------------------------------------------------------
    'C:\XAVIER\Archive

    srcDir = "C:\XAVIER\Archive\"
    DestDir = "C:\System_CleanUp\XAVIER\Archive\"
    If Right(srcDir, 1) <> "\" Then srcDir = srcDir & "\"
    If Right(DestDir, 1) <> "\" Then DestDir = DestDir & "\"

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set sh = wscript.CreateObject("WScript.Shell")

    FileSet = GetDirFiles(srcDir)
    intfile = 0
    intFiles = UBound(FileSet) + 1

    strComputer = "."
    Set objWMIService = GetObject("Winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
    For Each objItem In colItems
        inthorizontal = objItem.ScreenWidth
        intvertical = objItem.ScreenHeight
        'wscript.echo inthorizontal & " : " & intvertical
    Next

    strTitle = "Status-Bar"

    For Each File In FileSet
        intfile = intfile + 1
        x = CInt(intfile / intFiles * 100)
        msg = "File " & intfile & " of " & intFiles & vbCrLf
        Set File = fso.GetFile(srcDir & File)
        statusBar x, msg
        wscript.Sleep 10
        Date1 = File.DateLastModified
        Date2 = Now()
        'DDiff = Abs(DateDiff("h", Date1, Date2))
        DDiff = Abs(DateDiff("d", Date1, Date2))

        If DDiff >= 61 Then
            If Not fso.FileExists(DestPath & File.Name) Then
                File.Move DestDir
                'wscript.echo File.Name
            Else
                wscript.Echo "Unable to move file [" & File.Name & "].  A file by this name already exists in the target directory."
            End If
        End If
    Next

    wscript.Sleep 1000
    statusBar -1, ""
    Set objDoc = Nothing
    Set objIE = Nothing
    MsgBox "File move complete." & vbCrLf & "Starting folder cleanup"

    '-----------------------------------------------------------------------------------------------------------------------
    'XAVIER\Folder1
    
    If Right(srcDir, 1) <> "\" Then srcDir = srcDir & "\"
    If Right(DestDir, 1) <> "\" Then DestDir = DestDir & "\"

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set sh = wscript.CreateObject("WScript.Shell")

    'Getting the Folder Object
    Set ObjFolder = fso.GetFolder(srcDir)

    'Getting the list of SubFolders
    Set ObjSubFolders = ObjFolder.SubFolders

    FolderSet = GetDirFolders(srcDir)
    intFolder = 0
    intFolders = UBound(FolderSet) + 1

    strTitle = "Status-Bar"

    For Each ObjSubFolder In ObjSubFolders
        intFolder = intFolder + 1
        x = CInt(intFolder / intFolders * 100)
        msg = "Folder " & intFolder & " of " & intFolders & vbCrLf
        statusBar x, msg
        wscript.Sleep 10
        Date1 = ObjSubFolder.DateLastModified
        Date2 = Now()
        'DDiff = Abs(DateDiff("h", Date1, Date2))
        DDiff = Abs(DateDiff("d", Date1, Date2))

        If DDiff >= 40 Then
            If Not fso.FolderExists(DestPath & ObjSubFolder.Name) Then
                ObjSubFolder.Move DestDir
                'wscript.echo File.Name
            Else
                wscript.Echo "Unable to move folder [" & ObjSubFolder.Name & "].  A folder by this name already exists in the target directory."
            End If
        End If
    Next

    wscript.Sleep 1000
    statusBar -1, ""
    Set objDoc = Nothing
    Set objIE = Nothing
    MsgBox "Folder move complete"

    MsgBox "System Cleanup Complete"
    wscript.Quit

End If

Function statusBar(intPercent, strTitle)
'intPercent is limited to the range 0 ... 100.
'If intPercent is out of range, then the window is suppressed for those values

'Create the status bar window
    On Error Resume Next
    If objDoc Is Nothing Then
        If ((CInt(intPercent) >= 0) And (CInt(intPercent) <= 100)) Then
            Set objIE = CreateObject("InternetExplorer.Application")
            objIE.Offline = True
            objIE.AddressBar = False
            objIE.MenuBar = False
            objIE.statusBar = False
            objIE.Silent = False    'True
            objIE.Toolbar = False
            objIE.Navigate "about:blank"
            Do While objIE.Busy
                wscript.Sleep 100
            Loop
            'On Error Resume Next
            Set objDoc = Nothing
            Do Until Not objDoc Is Nothing
                wscript.Sleep 100
                Set objDoc = objIE.Document
            Loop
            objDoc.Open
            objDoc.Write "<html><head><title>" & strTitle & "</title></head>"
            objDoc.Write "<body><center>"
            objDoc.Write "<TABLE width=200 border=3 >"
            objDoc.Write "<tr><td>"
            objDoc.Write "<TABLE id=status width=0 border=0 cellpadding=0 cellspacing=0 bgcolor=#FFFFFF>"
            objDoc.Write "<tr><td>&nbsp</td></tr>"
            objDoc.Write "</table>"
            objDoc.Write "</td></tr>"
            objDoc.Write "</TABLE>"
            objDoc.Write "</body>"
            objDoc.Write "</html>"
            objDoc.Close
            With objIE.Document.ParentWindow.Screen
                objIE.Width = 200
                objIE.Height = 50
                objIE.Left = (.AvailWidth - objIE.Width) \ 2
                objIE.Top = (.Availheight - objIE.Height) \ 2
            End With
            objIE.Visible = True
        Else
            Exit Function
        End If
    Else
        objDoc.Title = strTitle
    End If

    'Close the status bar window
    If Not objDoc Is Nothing Then
        If ((CInt(intPercent) < 0) Or (CInt(intPercent) > 100)) Then
            objIE.Visible = False
            Set objDoc = Nothing
            objIE.Quit
            Set objIE = Nothing
            Exit Function
        End If
    End If

    'Update the status bar window
    If CInt(intPercent) = 0 Then
        objDoc.all.Status.Width = "0%"
        objDoc.all.Status.bgcolor = "#FFFFFF"
    Else
        objDoc.all.Status.Width = CStr(CInt(intPercent)) & "%"
        objDoc.all.Status.bgcolor = "#00CCFF"
    End If

    '    for each ie in createobject("shell.application").windows
    '        if instr(lcase(typename(ie.document)),"htmldocument") <> 0 then
    '            if ie.document.title = strTitle then
    '                ie.visible = true
    '                .appactivate ie
    '            end if
    '        end if
    '    next

End Function

Function GetDirFolders(FolderPath)
    Dim FolderCollection, aTmp(), i
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderCollection = fso.GetFolder(FolderPath).SubFolders

    ReDim aTmp(FolderCollection.Count - 1)
    i = -1

    For Each Folder In FolderCollection
        i = i + 1
        aTmp(i) = Folder.Name
    Next

    GetDirContents = aTmp
End Function

Function GetDirFiles(FolderPath)
    Dim FileCollection, aTmp(), i
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FileCollection = fso.GetFolder(FolderPath).Files

    ReDim aTmp(FileCollection.Count - 1)
    i = -1

    For Each File In FileCollection
        i = i + 1
        aTmp(i) = File.Name
    Next

    GetDirContents = aTmp
End Function

Open in new window

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Vicki05
Comment Utility
Sorry does not work at all. The folder move even does not have a folder and move to listed. Files do not move either.
0
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
Change Dim fso, FileSet, Path, File, DDiff, Date1, Date2, DestPath

to Dim fso, FileSet, Path, File, DDiff, Date1, Date2, DestPath, intAnswer

Change added in bold.
0
 

Author Comment

by:Vicki05
Comment Utility
I did add the intAnswer earlier, but I was not able to backup anything. Also for the folder, there is no path listed. I manually added the path with no success on the backup for files from one folder and folder and files from the next.

 '-----------------------------------------------------------------------------------------------------------------------
    'XAVIER\Folder1
   
    If Right(srcDir, 1) <> "\" Then srcDir = srcDir & "\"
    If Right(DestDir, 1) <> "\" Then DestDir = DestDir & "\"
0
 
LVL 26

Accepted Solution

by:
MacroShadow earned 500 total points
Comment Utility
Sorry.

Option Explicit

Dim filesys, newfolder
Dim fso, FileSet, Path, File, DDiff, Date1, Date2, DestPath
Dim srcDir, DestDir, intAnswer,intFiles, intFile, sh
Dim ObjFolder, ObjSubFolders, ObjSubFolder, FolderSet, intFolders, intFolder, Folder
Dim x, msg, strTitle, strComputer, objWMIService, colItems, inthorizontal, intvertical, objItem 
Dim objDoc    'Required global declaration for status bar document
Dim objIE    'Required global declaration for Internet Explorer object..

intAnswer = MsgBox("This Utility is Designed to Clean System old Data Files. Would you like to continue?", vbYesNo, "Run Program")

If intAnswer = vbNo Then
    MsgBox "You answered No. Click OK to exit"
    wscript.Quit
End If

If intAnswer = vbYes Then
    On Error Resume Next

    Set filesys = CreateObject("Scripting.FileSystemObject")
    If Not filesys.FolderExists("C:\System_CleanUp\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If
    If Not filesys.FolderExists("C:\System_CleanUp\XAVIER\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\XAVIER\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If
    If Not filesys.FolderExists("C:\System_CleanUp\XAVIER\Archive\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\XAVIER\Archive\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If

    If Not filesys.FolderExists("C:\System_CleanUp\XAVIER\Folder1\") Then
        newfolder = filesys.CreateFolder("C:\System_CleanUp\XAVIER\Folder1\")
        'Response.Write "A new folder '" & newfolder & "' has been created"
    End If

    '-----------------------------------------------------------------------------------------------------------------------
    'XAVIER\Folder1
    srcDir = "D:\Test\Source\"'"C:\XAVIER\Archive\"
    DestDir = "D:\Test\Destination\"'"C:\System_CleanUp\XAVIER\Archive\"
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set sh = wscript.CreateObject("WScript.Shell")

    'Getting the Folder Object
    Set ObjFolder = fso.GetFolder(srcDir)

    'Getting the list of SubFolders
    Set ObjSubFolders = ObjFolder.SubFolders

    FolderSet = GetDirFolders(srcDir)
    intFolder = 0
    intFolders = UBound(FolderSet) + 1

    strTitle = "Status-Bar"

    For Each ObjSubFolder In ObjSubFolders
        intFolder = intFolder + 1
        x = CInt(intFolder / intFolders * 100)
        msg = "Folder " & intFolder & " of " & intFolders & vbCrLf
        statusBar x, msg
        wscript.Sleep 10
        Date1 = ObjSubFolder.DateLastModified
        Date2 = Now()
        'DDiff = Abs(DateDiff("h", Date1, Date2))
        DDiff = Abs(DateDiff("d", Date1, Date2))

         If DDiff >= 40 Then
            If Not fso.FolderExists(DestPath & ObjSubFolder.Name) Then
                ObjSubFolder.Move DestDir
                'wscript.echo File.Name
            Else
                wscript.Echo "Unable to move folder [" & ObjSubFolder.Name & "].  A folder by this name already exists in the target directory."
            End If
         End If
    Next

    wscript.Sleep 1000
    statusBar -1, ""
    Set objDoc = Nothing
    Set objIE = Nothing
    MsgBox "Folder move complete" & vbCrLf & "Starting file cleanup"
    
    '------------------------------------------------------------------------------------------
    'C:\XAVIER\Archive

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set sh = wscript.CreateObject("WScript.Shell")

    FileSet = GetDirFiles(srcDir)
    intfile = 0
    intFiles = UBound(FileSet) + 1

    strComputer = "."
    Set objWMIService = GetObject("Winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
    For Each objItem In colItems
        inthorizontal = objItem.ScreenWidth
        intvertical = objItem.ScreenHeight
        'wscript.echo inthorizontal & " : " & intvertical
    Next

    For Each File In FileSet
        intfile = intFile + 1
        x = CInt(intFile / intFiles * 100)
        msg = "File " & intfile & " of " & intFiles & vbCrLf
        Set File = fso.GetFile(srcDir & File)
        statusBar x, msg
        wscript.Sleep 10
        Date1 = File.DateLastModified
        Date2 = Now()
        'DDiff = Abs(DateDiff("h", Date1, Date2))
        DDiff = Abs(DateDiff("d", Date1, Date2))

         If DDiff >= 61 Then
            If Not fso.FileExists(DestPath & File.Name) Then
                File.Move DestDir
                'wscript.echo File.Name
            Else
                wscript.Echo "Unable to move file [" & File.Name & "].  A file by this name already exists in the target directory."
            End If
         End If
    Next

    wscript.Sleep 1000
    statusBar -1, ""
    Set objDoc = Nothing
    Set objIE = Nothing
    MsgBox "File move complete."
	MsgBox "System Cleanup Complete"
    wscript.Quit

End If

Function statusBar(intPercent, strTitle)
'intPercent is limited to the range 0 ... 100.
'If intPercent is out of range, then the window is suppressed for those values

'Create the status bar window
    On Error Resume Next
    If objDoc Is Nothing Then
        If ((CInt(intPercent) >= 0) And (CInt(intPercent) <= 100)) Then
            Set objIE = CreateObject("InternetExplorer.Application")
            objIE.Offline = True
            objIE.AddressBar = False
            objIE.MenuBar = False
            objIE.statusBar = False
            objIE.Silent = False    'True
            objIE.Toolbar = False
            objIE.Navigate "about:blank"
            Do While objIE.Busy
                wscript.Sleep 100
            Loop
            'On Error Resume Next
            Set objDoc = Nothing
            Do Until Not objDoc Is Nothing
                wscript.Sleep 100
                Set objDoc = objIE.Document
            Loop
            objDoc.Open
            objDoc.Write "<html><head><title>" & strTitle & "</title></head>"
            objDoc.Write "<body><center>"
            objDoc.Write "<TABLE width=200 border=3 >"
            objDoc.Write "<tr><td>"
            objDoc.Write "<TABLE id=status width=0 border=0 cellpadding=0 cellspacing=0 bgcolor=#FFFFFF>"
            objDoc.Write "<tr><td>&nbsp</td></tr>"
            objDoc.Write "</table>"
            objDoc.Write "</td></tr>"
            objDoc.Write "</TABLE>"
            objDoc.Write "</body>"
            objDoc.Write "</html>"
            objDoc.Close
            With objIE.Document.ParentWindow.Screen
                objIE.Width = 200
                objIE.Height = 50
                objIE.Left = (.AvailWidth - objIE.Width) \ 2
                objIE.Top = (.Availheight - objIE.Height) \ 2
            End With
            objIE.Visible = True
        Else
            Exit Function
        End If
    Else
        objDoc.Title = strTitle
    End If

    'Close the status bar window
    If Not objDoc Is Nothing Then
        If ((CInt(intPercent) < 0) Or (CInt(intPercent) > 100)) Then
            objIE.Visible = False
            Set objDoc = Nothing
            objIE.Quit
            Set objIE = Nothing
            Exit Function
        End If
    End If

    'Update the status bar window
    If CInt(intPercent) = 0 Then
        objDoc.all.Status.Width = "0%"
        objDoc.all.Status.bgcolor = "#FFFFFF"
    Else
        objDoc.all.Status.Width = CStr(CInt(intPercent)) & "%"
        objDoc.all.Status.bgcolor = "#00CCFF"
    End If

    '    for each ie in createobject("shell.application").windows
    '        if instr(lcase(typename(ie.document)),"htmldocument") <> 0 then
    '            if ie.document.title = strTitle then
    '                ie.visible = true
    '                .appactivate ie
    '            end if
    '        end if
    '    next

End Function

Function GetDirFolders(FolderPath)
    Dim FolderCollection, aTmp(), i
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderCollection = fso.GetFolder(FolderPath).SubFolders

    ReDim aTmp(FolderCollection.Count - 1)
    i = -1

    For Each Folder In FolderCollection
        i = i + 1
        aTmp(i) = Folder.Name
    Next

    GetDirFolders = aTmp
End Function

Function GetDirFiles(FolderPath)
    Dim FileCollection, aTmp(), i
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FileCollection = fso.GetFolder(FolderPath).Files

    ReDim aTmp(FileCollection.Count - 1)
    i = -1

    For Each File In FileCollection
        i = i + 1
        aTmp(i) = File.Name
    Next

    GetDirFiles = aTmp
End Function

Open in new window

0
 

Author Comment

by:Vicki05
Comment Utility
Hi Macro,

I will test it. Sorry for the late reply.
0
 

Author Comment

by:Vicki05
Comment Utility
Hi Macro,

So far it works. One issue I ran into is that the Archive folder does not get checked.


 '-----------------------------------------------------------------------------------------------------------------------
    'XAVIER\Folder1
    srcDir = "D:\Test\Source\"'"C:\XAVIER\Archive\"
    DestDir = "D:\Test\Destination\"'"C:\System_CleanUp\XAVIER\Archive\"


Please advice.

Vicki
0
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
Is this what you used, or did you use the code in your last message?

    srcDir = "C:\XAVIER\Archive\"
    DestDir = "C:\System_CleanUp\XAVIER\Archive\"

Open in new window

0
 

Author Comment

by:Vicki05
Comment Utility
'-----------------------------------------------------------------------------------------------------------------------
     srcDir = "C:\Xavier\Folder1\"'"C:\Xavier\Archive\"
    DestDir = "C:\System_CleanUp\Xavier\folder1\"'"C:\System_CleanUp\Xavier\Archive\"


I tried backing up one folder that has files in it and one with folders and files.

The folder with files does get backed up, the folder with file only does not
0
 
LVL 26

Expert Comment

by:MacroShadow
Comment Utility
It works for me.
0
 

Author Closing Comment

by:Vicki05
Comment Utility
Thanks for your help.

I reused the script again to move the archive files.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now