Batch file for backups and updating development files to server

Creating batch file for backups and updating development version project to server.

1.The below code first create a backup from server to specified folder(current date) and copy a file from development system to server. use command used for connecting server, make sure server folder should be shared otherwise it will ask username and password.

3.once completed the backups , delete the net use object.

@echo off
set Todays=%date%
rem echo %Todays%
set BackupDate=%Todays:~4,2%%Todays:~7,2%%Todays:~10,4%

echo Please Get Latest Version and complied before continue this script.

net use k: \\\Hubbing

set DesinationPath="Presentation"
set BackupPath="Backups"

rem set LocalSourcePath="D:\PresentationLayer"
rem Input Get from the user and checking its valid
echo "Enter your local PresentationLayer with drive (ex.. D:\PresentationLayer")
set INPUT=
set /P INPUT=Type input:%=%
if "%INPUT%"=="" goto input
if not exist "%INPUT%" goto input
set LocalSourcePath=%INPUT%

rem backup
xcopy k:%DesinationPath% k:\%BackupPath%\%BackupDate%\*.* /r/y/e
rem copy from local source to server
xcopy %LocalSourcePath% k:\%DesinationPath%\*.* /r/y/e

net use k: /delete

Echo "Backup Successfully Completed ......"
Echo "Deployment Successfully Completed ..... GOOD DAY "



No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: