PDA

View Full Version : Batch file help please


redpipe67
February 24th, 2005, 06:54 AM
Hello,
I wonder if anyone could help me with a batch file i would like to create. The object is to have a text file on a cd rom along with the batch file. Executing the batch file would then copy the text file to C:\Program Files. I would need this batch file to be able to run under all versions of windows also. I was under the impression that as long as the batch file was in the same directory as the text file then all i would need to specify would be:

copy test.txt c:\Program Files

negating to account for the changing drive letter of a cd rom and could be used in different pc's with cd roms of varying drive letters but nothing happens.
Can someone let me know how this would be completed successfully.

Thank you very much
Andy

renegade600
February 24th, 2005, 12:18 PM
what drive are you in when you try to run the batch file?

Ned Seagoon
February 24th, 2005, 12:52 PM
Hi redpipe

Welcome to CTH

If you wish to do this with a batch file you need to use the DOS name for the Program File folder.

So your command would be:
copy test.txt C:\progra~1

You could also add a PIF file by selecting properties on the .bat file and checking 'close on exit' and 'run minimised'. This will make another file with the same name as the .bat file but without the .bat extension, that you will also need to place on the CD

However I am concerned that you wish to copy the file to the Program File directory. I hope it is a legitimate thing that you are asking us to help you with. BF

redpipe67
February 24th, 2005, 05:22 PM
Thanks for the reply guys,
Big Fred, the Program files was just for example purposes, i have collected a number of short home movies and photographs i want to distribute to family on cd's, executing the batch file would copy a text file containing family birthdays, addresses and telephone numbers and e-mail addresses to a folder so that everyone has that information on their pc in the same place.

Thanks again

degsy
February 24th, 2005, 06:26 PM
You'd be better off using a self extracting archive from a zip program such as Winzip.