Computing.Net > Forums > Programming > Batch CD-autorun?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Batch CD-autorun?

Reply to Message Icon

Name: Simon
Date: February 1, 2009 at 14:56:13 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Hi, I'm trying to create a batch-file that automatically runs when a cd is inserted into the cd-drive... I have made a file that has to be run manually, but I don't know if it is even possible to find the drive, also because the drive letter keeps changing.
Can you help?
Thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: February 2, 2009 at 08:14:20 Pacific
Reply:

If the script is on the CD, then you'd say:

set drive=%~d0


0

Response Number 2
Name: pball
Date: February 2, 2009 at 12:34:21 Pacific
Reply:

also going by the assumption razor is, if the batch is on the cd just use %CD% to get the current directory


0

Response Number 3
Name: Judago
Date: February 2, 2009 at 23:19:34 Pacific
Reply:

I'm not completely sure if it would work properly but what about a autorun.inf to start the script?

[AutoRun]
OPEN=yourscript.cmd

I know this is very obvious but I'm not sure if you had already got that far.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


c++ homework help - vecto... Need user input while run...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch CD-autorun?

Help with Batch File www.computing.net/answers/programming/help-with-batch-file/14978.html

Autorun code www.computing.net/answers/programming/autorun-code/10174.html

Batch file adding text to file also www.computing.net/answers/programming/batch-file-adding-text-to-file-also/16756.html