Jump to content
Sign in to follow this  
Guest BinaryVision

Backup Visual Studio .NET projects to the network

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.

*  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:        

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)
;set destination folder
  $destdir = $netpath & @UserName
;delete old copy on network if exists
  If FileExists($destdir) Then
;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)
;display confirmation message
  MsgBox(64+262144,"Automated Backup","Visual Studio .NET projects were copied to:" & @CR & @CR & $netpath & @UserName)
Edited by BinaryVision

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.