From: daveh on
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
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
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
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