I'm trying to configure autorun.inf on a DRIVE_REMOVABLE tagged USB flashdrive to run an .exe file from a subdirectory with parameters. So far I have had no luck using the information provided by msdn. I've also looked at several other questions here 1 2, and made sure AutoRun is enabled and disabled the group policy as explained in this answer.

One thing I noticed in the msdn shell_verb was the inconsistent usage of / and \ throughout this manual—I tried both ways but either seemed to work (I assume that it should be \). My autorun file is located in the root folder, some of the features seem to work, namely label= and icon=.

My autorun file looks like this now:

shellexecute= mysubfolder/myprogram.exe
shell/myverb/command=mysubfolder/myprogram.exe -myparameter
shell/myverb=Open &MyAction
open=mysubfolder/myprogram.exe -myparameter

but neither autorun of the exefile, shell\verb or the open command works as expected. I've also tried to only use open alone with action, label and icon. I've also tried to use commands such as run or start in the open-option. I cannot find any documentation that explain if they need to be in a specific order either.

Edit: I've also tried to edit the registry key3 NoDriveTypeAutoRun in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer to decimal 145 (hex 0x00000091) but this did not work either.

Any ideas?


Untested answer :

open=""mysubfolder\myprogram.exe -myparameter""

The lines above should be enough - I don't think the others are needed. Possibly the double-double-quotes can be replaced by single double-quotes.

Source : Autorun.inf cannot deal with the sub-folders with space in their folder name?

  • Nice catch, however, it did nothing to fix my issue.
    – Ole Aldric
    Nov 12 '18 at 1:18
  • Does it work without the parameter?
    – harrymc
    Nov 12 '18 at 7:28
  • No, it does not work with simple open=app.exe either. It's like the execution is disabled somehow.
    – Ole Aldric
    Nov 12 '18 at 15:02
  • It's maybe possible that Microsoft has decided to disable autorun for good. You should maybe do your tests on Windows 7, maybe in a VM. Once you know that your autorun.inf is correct and works on Windows 7 but not on Windows 10, then you will know that your problem is with Microsoft and not with the file.
    – harrymc
    Nov 12 '18 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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