Writing a simple batch file to back up .xlb file

Adrian1

Board Regular
Joined
Dec 30, 2003
Messages
126
I have written the following batch file to re-instate my default toolbars in excel should my machine go on the blink (thanks to drafter for earlier info!!):-

cd r:\
copy hall02a8.xlb c:\winnt\

when I am in a normal dos window, this works fine and copies the file from my shared drive on the network to my C: drive on this PC. When I run the batch file though, nothing seems to happen. Surely it should work as the commands are exactly the same. Anyone got any ideas?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
1. Need to run from a shortcut (not drag file to desktop).
2. Add the word PAUSE as last line when you hopefully see what is going on.
 

TryingToLearn

Well-known Member
Joined
Sep 10, 2003
Messages
723
Knowing that you created the batch file with an ascii editor like Notepad, NOT wordpad so that you don't have control characters in there I would suggest you try using xcopy instead:

xcopy r:\hall02a8.xlb c:\winnt\ /r

This batch file can also be created by typing the following inside of a command prompt window:


copy con fixtoolb.bat
xcopy r:\hall02a8.xlb c:\winnt\ /r
'Ctrl Z'
'Enter'


HTH
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,896
Messages
5,766,992
Members
425,392
Latest member
Booknerd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top