Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
4  
I'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 Apr 23 '10 at 23:48
add comment

1 Answer

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.

share|improve this answer
    
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 Apr 24 '10 at 4:20
1  
@Funky No, they fixed that in xp and onwards with AutoPlay. –  Corey Apr 24 '10 at 4:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.