Backup Files Using Windows PowerShell

Backs up files using Windows PowerShell.

 
 
 
 
 
4.3 Star
(28)
Add to favorites
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Second DoSubFolders bug
    1 Posts | Last post July 17, 2013
    • For each subdirectory in a directory, function "DoSubFolders" calls itself after calling function "BackupFolders"
      
      But this is not necessary because BackupFolders itself calls DoSubFolders. It is all that is required for the recursion down the directory tree.
      
      So that line should be removed from DoSubFolders:
      
        DoSubFolders $objSrcSubFolder $objDstSubFolder 
      
      The effect of keeping it in is that folders are often processed multiple times, which obviously increases the workload unnecessarily.
      
  • Auto create new folders and create folders based on local date
    3 Posts | Last post November 15, 2011
    • Excellent script but how/where can I change the script so that it creates a new folder based on the local system date and creates that folder without prompting about creating the folder. I tried entering the %date% variable at $strDestinationFolder but it only created the folder as '%date%
      
      0.o
    • For example I am using in my monthly backup script this:
      
      $folder = get-date -format yyyy-MM 
      
      and than I add this variable to the path...
      Example: E:\BackUp\2010-08
    • Thanks SaltFish!
  • A lot of questions you aren't answering...
    1 Posts | Last post November 10, 2011
    • I think the problem might be that you're posting scripts that are in the community, and so you aren't supporting the scripts here (i.e. you don't know the answers to these questions, because it isn't your script). Also the description is very light, which is probably why we have so many questions. Any way to get Greg Lyon to visit and answer some questions?
      
      Thanks!
  • does it keep the full path of source?
    1 Posts | Last post August 20, 2011
    • does it work keeping entire path of source and if i use an external drive like a usb hdd?
      
      and also how can i set an option of verifying if it has not been modifyed in a period of time to back it up and then after backup remove them ?? 
      
      thanks in advanced
  • How can I add multiple source directory and destinations directories
    1 Posts | Last post April 22, 2011
    • PS C:\PowerShell> .\backupfiles.p​s1
      How can I add multiple source directories and destinations directories
  • No success: two errors :-(
    1 Posts | Last post November 17, 2010
    • PS C:\PowerShell> .\backupfiles.ps1
      
      Backing up C:\Powershell to K:\Powershell
      
      Warning: destination folder does not exist
      Create folder and continue? : y
      
      Path             : K:\Powershell
      Name             : Powershell
      ShortPath        : K:\POWERS~1
      ShortName        : POWERS~1
      Drive            : System.__ComObject
      ParentFolder     : System.__ComObject
      Attributes       : 16
      DateCreated      : 17/11/2010 15:07:52
      DateLastModified : 17/11/2010 15:07:52
      DateLastAccessed : 17/11/2010 15:07:52
      Type             : Dossier de fichiers
      IsRootFolder     : False
      Size             : 0
      SubFolders       : System.__ComObject
      Files            : System.__ComObject
      
      Le terme « BackupFolder » n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
      Au niveau de C:\PowerShell\BackupFiles.ps1 : 51 Caractère : 13
      + BackupFolder <<<<  $objSourceFolder $objDestinationFolder
          + CategoryInfo          : ObjectNotFound: (BackupFolder:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      
      
      Folders are synchronized
      Le terme « WaitKey » n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
      Au niveau de C:\PowerShell\BackupFiles.ps1 : 65 Caractère : 8
      + WaitKey <<<<  "Press any key to exit ... "
          + CategoryInfo          : ObjectNotFound: (WaitKey:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      
      PS C:\PowerShell>
      
      Any comment anyone ?
      Thanks.
      (Windows 7)
  • Network
    2 Posts | Last post October 19, 2010
    • Any way to make this work having the destination on a password protected network share?
    • You would be able to use NET USE to map a drive at the beginning of the script and assign it a drive letter, then drop it when the script is completed.  Either way, you'd have to store the credentials, unless you used another process to map the network drive.