Link to home
Start Free TrialLog in
Avatar of raffie613
raffie613

asked on

Batch file for auto backup

Can someone help me write a batch file to stop the SQL service, copy a data folder on my external drive and paste it to my desktop, then restart SQL service ?
SOLUTION
Avatar of sshah254
sshah254

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of johnb6767
johnb6767
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of raffie613
raffie613

ASKER

ok, but I am running SQL express 2005 on my workstation, do not have a SQL server. Is the Net stop the same? Just use my computer name?
it should be something like SQLExpress instead.
Anyway you can know it either by issuing a :
tasklist /svc
on the command line.
Or running services.mscand right-click on the service. The name is the first field of the properties windows.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, and I write this batch file in Notepad? Where do I save it so it can run every night? How do I set the time that it should run?

save it wherever you want and then set up task manager from administrative tools/task scheduler as shown here