Jump to content

Backup Visual Studio .NET projects to the network


Guest BinaryVision
 Share

Recommended Posts

Guest BinaryVision

Set the destination path of a network drive/path and enjoy! You can easily set an executable to run at specified times using the built-in task scheduler of Windows XP, etc.

#cs
****************************************************************************************************
**********************
*  Script Purpose:  Backup Visual Studio project/web files to network drive
*  Script Author:   Andrew S
*  AutoIt Version:  3.1.1
*  Revision Date:   9/22/05
*  Last Revised By: 
*  Comments:        
****************************************************************************************************
**********************
#ce

Dim $netpath,$netstatus,$destdir

;prompt to start process
If MsgBox(1+64+262144,"Automated Backup","The system needs to backup your Visual Studio .NET projects." & @CR & _
 "Please close all open projects and click OK to continue.") = 1 Then
  
  $netpath = "xxxxxxxxxxxxxxxxxx"
  $netstatus = DriveStatus($netpath)
  
;display error with retry option if network drive unavailable
  While $netstatus = "INVALID"
    If MsgBox(5+48+262144,"Error","The system is unable to access " & $netpath & "." & @CR & _
     "Make sure the drive is accessible and click Retry to continue.") = 4 Then
      $netstatus = DriveStatus($netpath)
    Else
      Exit
    EndIf
  WEnd
  
;set destination folder
  $destdir = $netpath & @UserName
  
;delete old copy on network if exists
  If FileExists($destdir) Then
    DirRemove($destdir,1)
  EndIf
  
;copy local folders to network
  SplashTextOn("Automated Backup",@CR & "Copying files to network disk...",300,70,-1,-1,-1,"",14)
  DirCopy("C:\Inetpub\wwwroot",$destdir & "\wwwroot",1)
  DirCopy(@MyDocumentsDir & "\Visual Studio Projects",$destdir & "\projects",1)
  SplashOff()
  
;display confirmation message
  MsgBox(64+262144,"Automated Backup","Visual Studio .NET projects were copied to:" & @CR & @CR & $netpath & @UserName)
  
Else
  Exit
EndIf
Edited by BinaryVision
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...