PDA

View Full Version : Autorun scripts?


Buddha16
21 Nov 2005, 6:46pm
Anyone know how to write autorun scripts?

Shorty
21 Nov 2005, 6:52pm
Autorun for....? CD's??? login scripts...?

Buddha16
21 Nov 2005, 7:42pm
yea for cd's

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. :confused: :D

Shorty
21 Nov 2005, 8:24pm
http://www.highdesertsoftware.com/autorun.html

That will create the autorun.inf files for ya. The rest is just a simple .bat file that will copy & overwrite files ;)

Buddha16
22 Nov 2005, 5:15pm
what program do i tell it to run, it says i must select an exe.? :confused:

profdlp
22 Nov 2005, 5:40pm
A more specific description of what you are trying to do would be helpful. Do you want to autoplay music? Create a slideshow? Launch a program? Or...? :)

Buddha16
13 Dec 2005, 5:41pm
I want to make a file cd. So when i put the cd in it automatically writes the files to the hd and replaces old files. and thats it. :confused:

GrayFox
13 Dec 2005, 7:08pm
I want to make a file cd. So when i put the cd in it automatically writes the files to the hd and replaces old files. and thats it. :confused:
Cds are read only ... and you need a batch on a floppy for that.

Thrax
13 Dec 2005, 7:16pm
Of course CDs are read only, but he wants to copy files TO the hard drive, overwriting old files. Read the post.

Buddha16
15 Dec 2005, 4:22pm
right so a script that will just copy the files to a directory and overwrite old files....thanks to all by the way for your help. :D

Buddha16
22 Dec 2005, 3:51pm
any suggestions? :confused:

deicist
22 Dec 2005, 4:22pm
the autorun.inf doesn't need to point to a .exe, it can point to a .bat

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.

Buddha16
27 Dec 2005, 11:44pm
Thats exactly what i was needing, thanks. It seems pretty simple too. Tried it and i works like a champ. You think its possible to work backwards as well. ie... from hd to zip disk, if i tell the .bat file to copy off the hd to the disk? :thumbsup: