Answering a little more than asked, I'll point out some options you have when using the autorun.inf file :
Key Attributes
-
action=texto
Optional: auto-run item text, both in the context menu and in the auto-run media window.
-
icon=caminho
icon path to be used to represent media
You can reference an icon within an icon, executable, or dll by placing a comma + icon index inside the file:
app\ConsoleApplication.exe,0
-
label=texto
media title that appears in Explorer
-
open=caminho
path to automatic execution
Attributes for adding items to the context menu
-
shell=nome_comando_primario
indicates which is the primary menu, which appears in bold in the context menu, and will be used in double click
-
shell\nome_comando=texto
represents the title of the menu_name command_name ... there may be several titles for different_command_name:
shell\comandoA=Título comando A
shell\comandoB=Título comando B
-
shell\nome_comando\command=caminho
path of the executable that should be triggered by clicking the specific command. There should be one for each specified command title:
shell\comandoA\command=app\ConsoleApplication.exe
shell\comandoB\command=notepad.exe arquivos/leiame.txt
Map of parts of the Autorun.inf file
Below is a map showing where the texts placed in the Autorun.inf file should appear, as well as the relationship between the properties. I used colors to indicate related elements in various parts.
Completeexample
[autorun]action=ExecutarConsoleApplication.exe(action)open=app\ConsoleApplication.exe%0icon=app\ConsoleApplication.exe,0label=TítulodoCD(label)shell=iniciarshell\iniciar=Lançaraaplicação(shell\iniciar)shell\iniciar\command=app\ConsoleApplication.exe%0shell\leiame=&Leroaqruivoleiame.txt(shell\leiame)shell\leiame\command=notepad.exearquivos/leiame.txt
Application
usingSystem;namespaceConsoleApplication{classProgram{staticvoidMain(string[]args){Console.WriteLine(string.Join(" ", args));
Console.WriteLine("Olá mundo!");
Console.ReadKey();
}
}
}
Adding an icon to your app
Go to the properties of your executable project in the Application tab, then just select an icon file:
Reference
Autorun.inf Entries (MSDN)
link