Jump to content

Disabling autorun(.inf), but not autoplay


mahi

Recommended Posts

Maybe a strange request since most people either want Autorun completely disabled or fully enabled...

Ever since Windows 98 the autorun feature has annoyed me. You insert a cd and before you know it it launched an application. It's not that bad when it asks to install the application on the cd, but some cd's install crap without notice. Luckily it's easy to disable autorun in the registry.

But with the coming of Windows XP the autorun ability was extended with autoplay. When you insert a cd/dvd containing audio or video it will ask you if you want to play those. Using TweakUI I made a few new autoplay handlers so Media Player Classic automatically starts playing dvd or divx/xvid movies upon insertion. I really love this feature (I've set all the other handlers to 'take no action').

However, when I disable autorun in the Registry, I also lose autoplay. And I really don't want any autorun.inf applications starting.

Somehow I believe it must be possible. After all, there is no autorun.inf on an audio cd or video dvd. Yet Windows recognizes them and is able to perform the action I requested. So my idea is to leave autorun on (since autoplay seems to rely on that registry setting) but somehow to disable the execution of autorun.inf files. Since Windows looks for the autorun.inf file I thought maybe I could make Windows look for another (non-existing) file? I searched through the registry for 'autorun.inf' but couldn't find any match... Anyone knows where Windows stores the autorun.inf name so I can hex-edit it? Or maybe someone knows a better/other way to accomplish what I want?

Link to comment
Share on other sites


You can delete or edit the file association which directs the windows shell as to how to actually install an inf file. BUT I recommend EXTREME caution and I would do this only after making an exact copy of the correct command so I could run them manually or restore the file association when needed.

You can get there from Control Panel > Folder Options > File Types (tab) highlight any entry visible and then press the "I" key until it scrolls to INF. With INF highlighted click the Advanced button and highlight the Install entry after which you can click the Edit button to access the information you need to save.

You need to save ALL the information in the dialog window. Keeping a screen shot of it would be good but that won't get you the entire text in the Application Used To Perform Action area.

As an example this is what I see on my box and I would keep all of this data handy. Making note that "none" means the there is no data.

Action:

&Install

Application Used To Perform Action:

C:\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1

Use DDE:

checkmarked: YES

DDE Message:

none

Application:

setupapi

DDE Application NOT running:

none

Topic:

System

Link to comment
Share on other sites

I know about holding the shift key, but I usually forget to use it. I mean, who's gonna think that your brand new audio cd silently installs crap that disables audio extraction software... Or the new Star Wars dvd's which keep on installing a crappy dvd player while I don't want it.

I'll try what happens if I 'break down' the inf file extension in the registry. But I'm afraid, that may also disable the ability to install certain drivers.

I really hoped I could somewhere find a reference to 'autorun.inf'.

Link to comment
Share on other sites

Update... I played around a little with the *.inf Install options. Removing has no effect on autorun. The autorun.inf still gets executed as before. Even removing the complete .inf and inffile keys from the Registry didn't have any effect. So I don't think the *.inf filetype has any influence on the autorun behaviour. And I'd rather not mess with it as many drivers rely on it for installation.

But then, what controls the autorun.inf?

Link to comment
Share on other sites

AutoPlay looks for the autorun.inf to start the "AutoRun", I don't think there's an easy way out of this one... (that's why disabling the latter is done by disabling the first) I've been meaning to code a nice app to do this job properly for a while, all I'd need is some free time - which I'm not likely to have for that purpose anytime soon :( Unless you can email me some :lol:

btw, the autorun.inf has NOTHING to do with setupapi. Same extension as the other inf files, but completely different beast.

Link to comment
Share on other sites

Thanks for your input crahak!

Audio cd's, video dvd's, picture discs,... all get recognized by the content type sniffers (*) of Windows XP without an autorun.inf being present on the disc. Maybe autoplay shares the autorun code, but it absolutely does not depend on the autorun.inf file. So if I could just make Windows XP's autorun look for another (non-existing) file, rather than autorun.inf I think it would fix the problem. But I don't know where XP stores the 'autorun.inf' filename. It's not in the regsitry (at least not in plain text), and not in any txt/ini/... file. Maybe it's hardcoded in a DLL. That's not a problem, I can HEX edit that, but then I first need to know what file it is...

*: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\ContentTypeSniffers] and subkeys. If you want XP to look for other filetypes than the default, this is the place to be.

Link to comment
Share on other sites

Yes, it's hardcoded in a DLL (no real time to look), and I have not bothered looking, as I find XP's "content type sniffing" very lacking, slow, kludgy, featureless, and there's no real way to configure or improve it, so I just have AutoRun completely disabled instead. (autorun.inf is a bit of an issue for some things, like the interactual crap player, but that's only like 5% of the problem imho) That's the very reason why I wanted to replace it with my own, with custom, highly configurable options depending on media type, content type and everything.

Link to comment
Share on other sites

It's true the content type sniffing is limited since there are only three available categories. I don't know if it's slow since I haven't seen a fast sniffer in action, but for my needs it's perfect: It recognizes dvd video and xvid/divx cd's and performs the associated task.

I'm really looking forward to your approach. I hope you can get some free time somedays :)

I'll see if I can find the DLL in which the autorun.inf filename is hardcoded.

Link to comment
Share on other sites

I haven't been able to find a useful reference to autorun.inf in any DLL. I tried using UltraEdit's Search In Files function, but maybe that's not the right way. What software would be best suited to find this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...