Autorun scripts?
Buddha16
Austin, Tx Member
Anyone know how to write autorun scripts?
0
Comments
I don't know if it can be done. But i need a script that will copy the files on the cd (when i put it in) to a folder on the hd and overwrite older files. I appreciate any help. TIA.
That will create the autorun.inf files for ya. The rest is just a simple .bat file that will copy & overwrite files
a .bat file is a batch file, a simple text file that contains a series of commands to be executed. The command you want is 'copy' as in:
"copy d:\myfile.txt c:\myfolder\myfile.txt"
this will copy a file called myfile.txt from the d: drive (your CD drive hopefully) to a folder called myfolder on your c:\ drive. You can add the /y switch to the end of that command to make it not ask you about overwriting files. ie:
"copy d:\myfile.txt c:\myfolder\myfile.txt /y"
or, if you have lots of files you want to copy try this
"copy d:\*.* c:\myfolder"
This will copy any files (*.* uses wildcard characters to select all files) in the root (lowest level) of the D: drive into the myfolder folder on the c drive.
so, create a simple text file with a series of those copy commands in it, call it 'runme.bat' (or something.bat) and point your autorun.inf at it.
Hope that helps.
edit: here's a more specific example. lets say we have a folder on our cd called 'files' that has a number of files in it. we want to insert that cd and automatically copy those files to a folder on our c: drive called 'copied_files'. now, first we need to create our batch file. create a new text file and put the following line into it:
copy d:\files\*.* c:\copied_files /y
now, save that file and name it 'runme.bat'.
Now we need to create our autorun.inf. create another new text file and put these lines into it:
[autorun]
open=runme.bat
save that file as 'autorun.inf'
and that's basically all you need to do. make sure those 2 files are in the root of your CD and your files are in a folder on the CD called 'files' and you should be set to go. This assumes your cd drive is D: and your hard drive is C: but you can change those as applicable.