Batch file to copy a BKF file to a named drive, not a drive letter ?

By ghost123uk ·
I need to set a scheduled task to run that invokes a batch file to copy a MS backup file ( BKF ) to a USB memory stick.

Problem is that if the user puts another USB storage device in the machine, the drive letters will change.

So I need to name the USB memory stick and create a batch file that will send the BKF file to the drives name, not it's letter.

I know it can be done as I saw a page about exactly this on the net but now cannot find it again !!

Any thoughts folks, thanks for looking.

John in the N.W. UK

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Change Drive Letter

by bincarnato In reply to Batch file to copy a BKF ...

Why not just connect the USB drive that you plan to use for backup and change the drive letter to something higher that won't get used by another device. Then, every time you connect it, the drive letter will be what you changed it too?

Collapse -

Thanks for the input, but not quite the watertight solution I need

by ghost123uk In reply to Change Drive Letter

Yes, had thought of that, but this is for a small businesses backup and they are not too good with PC's. If you do as you suggest and then stick another make / model of USB stick in the machine it stops remembering the drive letter ( say "X" ) that you assigned. You put the one for the backups to go on back in and it reverts bask to "F".

Nearly there but not quite, thanks for the input though, best regards, John in the N.W. UK

Collapse -

See how you go with this

by Jacky Howe In reply to Batch file to copy a BKF ...

Open explorer and create a new folder. Something like USB. Insert the Memory stick. Open Computer Management, Disk Management and right click on the removable disk. Select Change Drive Letter and Paths. Here you can select a Drive Letter of choice by clicking Change, Select Add. Navigate to the folder and Select it and press OK. From now on when you insert the Memory stick you will have a copy of the contents in the new folder. You can set the batch file to the new drive letter or to the Folder Name without it ever changing.

Note: This will not work if the Memory Stick isn't inserted.

Collapse -

Good thinking Tru Blue, and let it have letter as well and ->

by ghost123uk In reply to See how you go with this

Yes that works :) :)

(You forgot to mention the "mount in the following empty NTFS folder" bit and I only mention it here in case others reading this solution didn't understand that).

You cannot safely "stop" the drive to remove it, but as you can remove it after you turn the PC off to go home from work, so that is no big problem.

The batch file to squirt a file at the "folder" ( ie the USB drive itself ) works fine :)

We found that another trick is to allow the drive to have a letter as well ( we used "X" ) this way you can check the properties such as free space etc (which you cannot do with a mounted volume).

So it looks like a winner - well done and thanks. ( probably find the snag tomorrow !!! )

Collapse -

No save the Snags

by Jacky Howe In reply to Good thinking Tru Blue, a ...

for the BBQ.
I will have to fix my fix and add the mount info.

Related Discussions

Related Forums