Stuck writing a batch file

  Chris the Ancient 11:40 14 Apr 2008

This sort of thing is something I haven't done in many, many years - and already, I'm stuck }-((

I'm using XP Home.

Basically, at the end of the working day, I want to click one icon and copy the day's work to two locations - one on my D: drive and one on my laptop.

What I have tried so far...

@echo off
xcopy C:\Documents and Settings\My Name\Desktop\First File.xls D:\$Data\Accounts\Accounts 08-09 m/e/y

Of course, that doesn't work! Now, I know, DOS doesn't handle names over eight characters or spaces either.

So, how do I do it? And across my wireless network to my laptop?

I know Briefcase could (possibly) do what I want. But, I've got the bit between my teeth over this and I really want to satisfy my curiosity on this.

Additionally, I believe that Win XP can't handle automation of such a batch file on close down?

I'd rather like to get my head round this rather than use the long-winded 'manual' method I use at the moment.

I'm out most of this afternoon; but I will keep checking in and may be rather late with any replies.



  Diemmess 12:00 14 Apr 2008

A very good way if you don't mind copying to one destination at a time is EZBackitup click here

Once set up with which files you need to copy and where to paste them, a single click does it.

  VoG II 12:04 14 Apr 2008

I wouldn't start from there if I was you!

I use SyncToy click here to copy work on my laptop remotely to mirror folders on a server. Once set up it is very easy to use.

I would use the Synchronize option and do one-way synchronizations only = i.e. from My Documents to D: and to your laptop,

  I am Spartacus 12:06 14 Apr 2008

Enclose any references to folders greater than 8 characters or with a space in quotes e.g. "Documents and Settings"

I'm interested to know a solution to referencing network drives.

  powerless 12:16 14 Apr 2008

If you were using XP Professional you can have the batch file kick in at shutdown/restart or when logging off. But not possible on Home [without third party).

You have not stuck quotes around those locations and I've added another switch:

@echo off
xcopy /m /e /i /y "C:\Documents and Settings\My Name\Desktop\First File.xls" "D:\$Data\Accounts\Accounts 08-09"

However you are doing this across a network, so the above will not work.

The destination points to a local drive and not on a network.

You would need to use:

@echo off
xcopy /m /e /i /y "C:\Documents and Settings\My Name\Desktop\First File.xls" "\\hostname\$Data\Accounts\Accounts 08-09"

Where \\hostname is the name of your laptop computer.

  Chris the Ancient 12:26 14 Apr 2008

Turn my back for a couple of moments and... WOW!!!
Millions of replies!

I'm just about to have an early lunch and go out to work.

But I will peruse all those in greater depth when I get back later. And then feed back on it all.

Many thanks.


  Switcher 13:43 14 Apr 2008

One way t make XP handle a batch file on close down would be to use the same batch file to shut
the PC down by making the last line.
Call Shutdown -t xx where xx =time in seconds

  Chris the Ancient 16:40 14 Apr 2008

A good added line which I had forgotten about! Which will be added when all is working.

Now to start playing...

  Chris the Ancient 18:41 14 Apr 2008

Having got the syntax correct - Thank You Powerless - I'm starting to build trial systems to achieve my (ever expanding) wants.

I did look at the alternatives offered, but they didn't quite fit my objectives and I felt it was about time that I exercised some of the redundant DOS skills that I used to have.

Quite what the eventual outcome and methodology will be is a little uncertain at the moment, but that will develop.

So, as it says at the top... Thanks for the help and input, everybody.


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

50 best online Adobe XD tutorials

iPad Pro 10.5in (2017) review

Comment connecter un MacBook à une TV ?