From: daveh on 16 Jan 2007 09:13 Hi All, I am trying to write a script that will backup a couple of networked folders to a removeable hard drive everyday. It is about 10Gig of data, so I scheduled the script to run in the middle of the night. The problem is I cannot get the FOF_NOCONFIRMATION flag to work, so the "Do you wish to overwrite" dialog continually pops up, and Needless to say, I am not around to click "Yes to All" The script is below. Thanks for your help. Dave DayOfWeek = WeekdayName(Weekday(Now)) Const FOF_NOCONFIRMATION = &H10 BackupFolder1 = "G:\Backup\" & DayOfWeek & "\Engineering" BackupFolder2 = "G:\Backup\" & DayOfWeek & "\Production" Set objShell = CreateObject("Shell.Application") Set objBackupFolder1 = objShell.NameSpace(BackupFolder1) Set objBackupFolder2 = objShell.NameSpace(BackupFolder2) objBackupFolder1.CopyHere "N:*", FOF_NOCONFIRMATION objBackupFolder2.CopyHere "P:*", FOF_NOCONFIRMATION
From: Ayush on 16 Jan 2007 11:00 Replied to [daveh]s message : > DayOfWeek = WeekdayName(Weekday(Now)) > > Const FOF_NOCONFIRMATION = &H10 > > BackupFolder1 = "G:\Backup\" & DayOfWeek & "\Engineering" > BackupFolder2 = "G:\Backup\" & DayOfWeek & "\Production" > > Set objShell = CreateObject("Shell.Application") > Set objBackupFolder1 = objShell.NameSpace(BackupFolder1) > Set objBackupFolder2 = objShell.NameSpace(BackupFolder2) > > objBackupFolder1.CopyHere "N:*", FOF_NOCONFIRMATION > objBackupFolder2.CopyHere "P:*", FOF_NOCONFIRMATION > Change Const FOF_NOCONFIRMATION = &H10 to Const FOF_NOCONFIRMATION = &H10& More info at : http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_vrwr.mspx -- → Ayush ------------- Search - www.Google.com | Wikipedia - http://en.wikipedia.org Snip your long urls - http://snipurl.com/ -------------
From: daveh on 16 Jan 2007 11:11 Thank you for the response, unfortunately, I tried what you suggested and still recieved the "Confirm Folder Replace" dialog box. Dave Ayush wrote: > Replied to [daveh]s message : > > DayOfWeek = WeekdayName(Weekday(Now)) > > > > Const FOF_NOCONFIRMATION = &H10 > > > > BackupFolder1 = "G:\Backup\" & DayOfWeek & "\Engineering" > > BackupFolder2 = "G:\Backup\" & DayOfWeek & "\Production" > > > > Set objShell = CreateObject("Shell.Application") > > Set objBackupFolder1 = objShell.NameSpace(BackupFolder1) > > Set objBackupFolder2 = objShell.NameSpace(BackupFolder2) > > > > objBackupFolder1.CopyHere "N:*", FOF_NOCONFIRMATION > > objBackupFolder2.CopyHere "P:*", FOF_NOCONFIRMATION > > > > > Change > Const FOF_NOCONFIRMATION = &H10 > > to > Const FOF_NOCONFIRMATION = &H10& > > > More info at : > http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_vrwr.mspx > > > > -- > â Ayush > ------------- > Search - www.Google.com | Wikipedia - http://en.wikipedia.org > Snip your long urls - http://snipurl.com/ > -------------
From: E C H on 16 Jan 2007 17:45 daveh wrote: > Thank you for the response, unfortunately, I tried what you suggested > and still recieved the "Confirm Folder Replace" dialog box. > > Dave > <SNIP> Here is a script that I have been using for a long time, it works really well. It zips directory's, it keeps a determined number of backups based on a variable, it can be configured for any compression program that takes arguments, I use winrar. http://www.eykamp.com/gistools/backups/download.htm
|
Pages: 1 Prev: Environment variables on remote computer Next: Adding email function |