Open PDF when USB is plugged in

3

I have a PDF file on an USB drive. How do I get it to open automatically when I plug in the USB drive? No dialog or anything, just open the PDF directly after the UBS drive is plugged in. Let's say we have to do this in win XP. autorun.inf does not seem to be able to do it.

Funky Dude

Posted 2010-04-23T23:39:05.037

Reputation: 169

4I'd just like to mention that enabling USB to autorun executables is a terrible security risk. Of course, I don't know your intent, just noting the issue. – Zurahn – 2010-04-23T23:48:42.250

Answers

2

From Wikipedia:
Inf handling

  • Windows XP, prior to Service Pack 2
    Introduction of AutoPlay.
    Drives of type DRIVE_REMOVABLE do not use the autorun.inf file. Any discovered removable media are handled by AutoPlay. All other handling is as before.

  • XP Service Pack 2 and up (includes Vista)

    Drives of type DRIVE_REMOVABLE now use autorun.inf but continue to be handled by AutoPlay. Any specified AutoRun task needs to be paired with the mandatory action key to appear as an option within the AutoPlay dialog. Otherwise the AutoRun task is omitted.
    All other handling is as before.

This will allow your pdf to show up on AutoPlay but it will not run automaticly. In autorun.inf

[autorun]
action=text
open=autorun.bat

Replace text with what you want to show up on AutoPlay.

In autorun.bat

start yourpdf.pdf

Replace yourpdf.pdf with the file of your choice.

Corey

Posted 2010-04-23T23:39:05.037

Reputation: 464

thanks for the answer but it still opens an autoplay dialog box and let user select. is there any way to get rid of that? – Funky Dude – 2010-04-24T04:20:20.193

1@Funky No, they fixed that in xp and onwards with AutoPlay. – Corey – 2010-04-24T04:45:04.220