You are here:

C#/Backup .BAT File


I am running win7 and I wanted to make a .BAT File that when I click on it it will run a Backup.

I want to Backup a Folder called Notes on my Desktop on my C: Drive to my E: Drive.

So I did this code in notepad and saved it as .bat and yes I changed file format to ALL in the dropdown list.

xcopy c:\Users\Robert\Notes
e:\Roberts Backup


And this last line of code sould output a text Log file to my Desktop. But when I click this file it looks like it is trying to open I can see an outline of a big window and then it goes away.

And it never Runs or Backsup the Folder.

I just would like to know how to do this code thanks.


couple of questions.

1.  Do you want to execute backup from the code? or you want to your application to create .BAT file?

2. DO you want to run this as a EXE or BAT?  if you want to do develop in c# you can execute this as EXE NOT as BAT.

Please let me know so that I can point to right direction.




All Answers

Answers by Expert:

Ask Experts


Srini Nagarajan


can answer any kind of questions in ASP.NET, C#, VB.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase


Contact me if you need any custom development on ASP.NET, ASP, Coldfusion, Powerbuilder

©2016 All rights reserved.