Batch file help..?

  wx622 16:29 01 Mar 2005
Locked

Does anyone know how to make a batch file in Windows XP that will give you a choice of options, the first being to create a new folder in the root of the drive you are using, the second to copy the contents of a folder in a profile, such as My Documents in C:\Documents and Settings\USER\My Documents (eg. your profile) to the folder you created in option 1?

Please help. I know how to do this in Win98, but CHOICE is no longer supported, and I don't know how to use SET properly.

  Eric10 17:35 01 Mar 2005

Would it perhaps be easier to copy CHOICE.COM to your Win XP box and use what you are used to? If you don't have a copy click here for the MS-DOS Supplemental Disk which includes it.

  Jeffers22 17:37 01 Mar 2005

I use batch files (under XP) to make simple backups of files and folders within the user area to a data partition. The destination folders already exist though.

To explore further take a look at these two pages from MS.

click here

click here

Hers is one I made for a friend to back some stuff up to a USB flash disk which was at X:

Echo off
Rem This batch file will make back up copies of your files to the USB disk
Echo.
Echo.
Echo READY TO BACKUP MY DOCUMENTS TO USB DISK - IF DISK ATTACHED .....
Echo.
Echo.
PAUSE
Xcopy /S N:\"Documents and Settings"\"John Smith"\"My Documents"\*.* X: /Y
Echo.
Echo.
Echo DONE: READY TO BACK UP ADDRESS BOOK
Echo.
Echo.
PAUSE
Copy N:\"Documents and Settings"\"John Smith"\"Application Data"\Microsoft\"Address Book"\"John Smith.wab" X:\"Address Book_BU"
PAUSE
Echo.
Echo.
Echo DONE: READY TO BACK UP MAIL BOXES
Copy N:\"Documents and Settings"\"John Smith"\"Local Settings"\"Application Data"\"Identities"\"{67E2EDF5-84C7-48AE-8D34-7E9AC0617923}"\"Microsoft"\"Outlook Express"\*.* X:\"Mail Boxes_BU"
Echo.
Echo.
Echo ALL DONE
Echo.
Echo.
PAUSE
EXIT

  wx622 09:02 02 Mar 2005

This is excellent. Thank you very much, Jeffers22. Now, do you have any idea how to include a way in which "John Smith" in "N:\"Documents and Settings"\"John Smith"\"My Documents"\*.* can changed to a wildcard, so it will copy files in different profiles? e.g. "[email protected]"?

This would be very helpful.

  Jeffers22 11:21 02 Mar 2005

Sorry, no I don't off the top of my head. There may be something in the MS knowledge base that will help though.

Did you try Eric10's suggestion? with what results?

  wx622 11:27 02 Mar 2005

Eric10's suggestion will not work unfortunately, since I need to run the batch file on multiple machines.

Any other ideas?

  wx622 10:01 03 Mar 2005

I have solved it:

set backupcmd=Xcopy /s /c /d /e /h /i /r /k /y

%backupcmd% "%USERPROFILE%\%USERNAME% Offline Work">>C:\%USERNAME%.log "%drive%\%USERNAME% - Offline Work">C:\%USERNAME%.log

Easy, after a bit of messing around.
Many thanks to both of you.

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

Elsewhere on IDG sites

HP Envy x2 review: Hands-on

How Sketch and InVision have revolutionised our design workflow

The best tech gifts for Christmas 2017

Les meilleurs jeux de société (2017)