|
|
#1 |
|
Beta Member
Join Date: Apr 2010
Posts: 3
|
I would like to write a program that automatically copies a file from a CD to the "My Documents" folder.
I'm working on making a spreadsheet available from a CD and don't want the user to have to manually save the file to their computer. Would it also be possible to edit the program so it copies the file to "My Documents." AND opens the file from that location at the same time? Any advice? |
|
|
|
|
|
#2 |
|
Site Team
Join Date: Jul 2009
Posts: 2,627
|
This can be accomplished pretty easily with a simple batch file (as long as the CD drive letter stays the same.)
Code:
copy D:\cdSpreadSheet.xls C:\pathToDocuments\spreadSheet.xls start "C:\program files\pathToExcel\excel.exe" C:\pathToDocuments\spreadSheet.xls If you don't know what the CD drive letter is, things get slightly more complicated.
__________________
Save the whales, feed the hungry, free the mallocs. |
|
|
|
|
|
#3 |
|
Beta Member
Join Date: Apr 2010
Posts: 3
|
Thanks for the help!
This is the file I'm working with right now, is there a way to modify it so the program gets launched? The one below works great for copying it but not for opening it. @echo off echo Copying Files from CD... echo Please Wait... ::variables set cdcopy=xcopy /s /c /e /h /i /r /y /d set dest=%userprofile%\My Documents set files=\Location\onCD\file.xls %cdcopy% "D:\%files%" "%dest%\" %cdcopy% "E:\%files%" "%dest%\" %cdcopy% "F:\%files%" "%dest%\" %cdcopy% "G:\%files%" "%dest%\" %cdcopy% "H:\%files%" "%dest%\" %cdcopy% "I:\%files%" "%dest%\" %cdcopy% "J:\%files%" "%dest%\" %cdcopy% "K:\%files%" "%dest%\" %cdcopy% "L:\%files%" "%dest%\" %cdcopy% "M:\%files%" "%dest%\" %cdcopy% "N:\%files%" "%dest%\" %cdcopy% "O:\%files%" "%dest%\" %cdcopy% "P:\%files%" "%dest%\" %cdcopy% "Q:\%files%" "%dest%\" %cdcopy% "R:\%files%" "%dest%\" %cdcopy% "S:\%files%" "%dest%\" %cdcopy% "T:\%files%" "%dest%\" %cdcopy% "U:\%files%" "%dest%\" %cdcopy% "V:\%files%" "%dest%\" %cdcopy% "W:\%files%" "%dest%\" %cdcopy% "X:\%files%" "%dest%\" %cdcopy% "Y:\%files%" "%dest%\" %cdcopy% "Z:\%files%" "%dest%\" cls echo Copy Complete... Exit |
|
|
|
|
|
#4 |
|
Daemon Poster
Join Date: Jul 2009
Posts: 866
|
Might want to specify that batch file on the CD in an 'autorun.INF' file on the CD, if you want it to copy automatically when the CD is inserted
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|