| |
doctortt
Posts: 73
Score: 0
Joined: 6/15/2007
Status: offline
|
Here is the script. I just can't get the back up registry part working. Please take a look at the bold lines. Again, I'm new to this. Any help will be appreciated. Thanks. Option Explicit 'On Error Resume Next Dim objFSO, objFolder, strFolderName, WshShell, LavaRegistry Dim StrMonth, StrDay, StrYear, RootFolder, StrCommand, strDate, strDelMax Dim retDate, subfolder, Folder RootFolder = "H:\LavaBkup" Set WshShell = WScript.CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") strDate = Now strDelMax = 30 StrMonth = Month(Date) StrDay = Day(Date) StrYear = Year(Date) strFolderName = "H:\LavaBkup\" & strMonth & "-" & strDay & "-" & StrYear strCommand = "regedit /e" & strFolderName & "\ backup.reg HKEY_LOCAL_MACHINE\Software\ActiveTouch" '================================================ If Len(strMonth) = 1 Then strMonth = "0" & strMonth End If If Len(strDay) = 1 Then strDay = "0" & strDay End If '================================================ If Not (objFSO.FolderExists(RootFolder)) Then objFSO.CreateFolder(RootFolder) End if If Not (objFSO.FolderExists(strFolderName)) Then objFSO.CreateFolder(strFolderName) End if '================================================ WshShell.Run(strCommand) '================================================ Set Folder = objFSO.Getfolder(RootFolder) For each subfolder in Folder.subfolders RetDate = datediff("d",subfolder.datelastmodified,strDate) If retDate > strDelMax then objFSO.Deletefolder(subfolder.Path) End if Next '================================================
|
|