How can I create a autorun.inf for executables in subdirectory, with parameters, on windows 10?

0

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:

[AutoRun]
action=MyActionName
shellexecute= mysubfolder/myprogram.exe
shell/myverb/command=mysubfolder/myprogram.exe -myparameter
shell/myverb=Open &MyAction
open=mysubfolder/myprogram.exe -myparameter
icon=myprogram.ico
label=MyDeviceName

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?

windows-10
usb-flash-drive
autorun
asked on Super User Nov 11, 2018 by Ole Aldric • edited Nov 12, 2018 by Ole Aldric

1 Answer

0

Untested answer :

open=""mysubfolder\myprogram.exe -myparameter""
icon="mysubfolder\myprogram.exe,0"
action=MyActionName

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?

answered on Super User Nov 11, 2018 by harrymc

User contributions licensed under CC BY-SA 3.0