Newsgroup: it.comp.lang.visual-basic
Titolo: File Autorun.inf

Un saluto a tutti i partecipanti al NG
Scusate la mia ignoranza.
Con un file come da oggetto, è possibile lanciare un file exe
all'inserimento di un CD: open=miofile.exe.
Si può avviare una pagina html con lo stesso procedimento? Come?
Grazie per l'aiuto.
Saluto tutti.
Daniele

 Si può avviare una pagina html con lo stesso procedimento? Come?
Un attimo OT... ma oggi ho dichiarato la "giornata degli Ot" e quindi
rispondo 8naturalmente con un bel copia-incolla da msdn):
(ciao
ugo)
Creating an AutoRun-Enabled Application
Creating an AutoRun-enabled CD-ROM application is a straightforward
procedure. You simply include two essential files:
An Autorun.inf file
A startup application
When a user inserts a disc into a CD-ROM drive on a AutoRun-compatible
computer, the system immediately checks to see if the disc has a personal
computer file system. If it does, the system searches for a file named
Autorun.inf. This file specifies a setup application that will be run, along
with a variety of optional settings. The startup application typically
installs, uninstalls, configures, and perhaps runs the application.
Creating an Autorun.inf File
The [DeviceInstall] Section
Tips for Writing AutoRun Startup Applications
Creating an Autorun.inf File
Autorun.inf is a text file located in the root directory of the CD-ROM that
contains your application. Its primary function is to provide the system
with the name and location of the application's startup program that will be
run when the disc is inserted. The Autorun.inf file can also contain
optional information including:
The name of a file that contains an icon that will represent your
application's CD-ROM drive. This icon will be displayed by Microsoft®
Windows® Explorer in place of the standard drive icon.
Additional commands for the shortcut menu that is displayed when the user
right-clicks the CD-ROM icon. You can also specify the default command that
is run when the user double-clicks the icon.
Autorun.inf files are similar to .ini files. They consist of one or more
sections, each headed by a name enclosed in square brackets. Each section
contains a series of commands that will be run by the Shell when the disc is
inserted. There are two such sections that are currently defined for
Autorun.inf files:
The [autorun] section contains the default AutoRun commands. All Autorun.inf
files must have an [autorun] section.
An optional [autorun.alpha] section can be included for Microsoft® Windows
NT 4.0 systems running on RISC-based computers. When a disc is inserted in a
CD-ROM drive on a RISC-based system, the Shell will run the commands in this
section instead of those in the [autorun] section.
Note The Shell checks for an architecture-specific section first. If it does
not find one, it uses the information in the [autorun] section. After the
Shell finds a section, it ignores all others, so each section must be
self-contained.
Each section contains a series of commands that determine how the Autorun
operation takes place. There are five commands available:
CommandDescription
defaulticon Specifies the default icon for the application.
iconSpecifies the path and file name of an application-specific icon for the
CD-ROM drive.
openSpecifies the path and file name of the startup application.
shellDefines the default command in the CD-ROM's shortcut menu.
shell\verbAdds commands to the CD-ROM's shortcut menu.
The following is an example of a simple Autorun.inf file. It specifies
Filename.exe as the startup application. The second icon in Filename.exe
will represent the CD-ROM drive instead of the standard drive icon.
[autorun]
open=Filename.exe
icon=Filename.exe,1
This Autorun.inf sample runs different startup applications depending on the
type of computer:
[autorun]
open=Filename_x86.exe
icon=IconFile.ico
[autorun.alpha]
open=Filename_RISC.exe
icon=IconFile.ico
The [DeviceInstall] Section
You can use the [DeviceInstall] section on any removable media. It is
supported only under Microsoft Windows XP. You use its one command,
DriverPath, to specify a directory path where Windows XP searches for driver
files, which prevents a lengthy search through the entire disc drive.
You use the [DeviceInstall] section with a driver installation to specify
directories where Windows XP should search the media for driver files. Under
Microsoft® Windows® XP, entire media are no longer searched by default,
therefore requiring [DeviceInstall] to specify search locations. The
following are the only removable media that Windows XP fully searches
without a [DeviceInstall] section in an Autorun.inf file:
Floppy disks found in drives A or B.
CD/DVD media less that 1 gigabyte (GB) in size.
All other media must include a [DeviceInstall] section for Windows XP to
detect any drivers stored on that media.
Note As with the [AutoRun] section, the [DeviceInstall] section can be
architecture-specific.
Tips for Writing AutoRun Startup Applications
There are essentially no constraints on how to write an AutoRun startup
application. You can implement it to do whatever you find necessary to
install, uninstall, configure, or run your application. However, the
following tips provide some guidelines to implementing an effective AutoRun
startup application.
Users should receive feedback as soon as possible after they insert an
AutoRun compact disc into the CD-ROM drive. Startup applications should thus
be small programs that load quickly. They should clearly identify the
application and provide an easy way to cancel the operation.
Typically, the initial part of the startup application presents users with a
user interface, such as a dialog box, asking them how they would like to
proceed. Check to see if the program is already installed. If not, the next
step will probably be the setup procedure. The startup application can take
advantage of the time the user spends reading the dialog box by starting
another thread to begin loading the setup code. By the time the user clicks
OK, your setup program will already be partly if not fully loaded. This
approach significantly reduces the user's perception of the amount of time
it takes to load your application.
If the application has already been installed, the user probably inserted
the disk to run the application. As with the setup case, you can start
another thread to begin loading application code to shorten the waiting time
for the user.
Hard disk space may be a limited resource on some systems. Here are a few
hints for minimizing hard disk usage:
Keep the number of files that must be on the hard disk to a minimum. They
should be restricted to files that are essential to running the program or
that would take an unacceptably large amount of time to read from the
CD-ROM.
In many cases, installing nonessential files on the hard disk is not
necessary, but may provide benefits such as increased performance. Give the
user the option of deciding how to make the tradeoff between the costs and
benefits of hard disk storage.
Provide a way to uninstall any components that were placed on the hard disk.
For more information about uninstalling an application, see Installing
Applications.
If your application caches data, give the user some control over it. Include
options in the startup application such as setting a limit on the maximum
amount of cached data that will be stored on the hard disk, or having the
application discard any cached data when it terminates.
Even though a CD-ROM has an Autorun.inf file, AutoRun can be suppressed
programmatically or disabled entirely with the registry. See Enabling and
Disabling AutoRun for more information

già, bel problema!
:-)
io ho fatto così: ho preso uno qualsiasi dei CD di IoProgrammo (che usano
pagine html come vuoi tu) e ho visto come fanno. l'autorun.inf è scritto
così:
open=start miofile.html
il file start è un exe (fatto in c++) che evidentemente vede l'estensione
del file e lo lancia con il programma associato. Ho provato a mettere start
pippo.doc ed in effetti il meccanismo di autorun mi ha fatto partire Word!!!
:-))
molto probablmente quel start.exe non fa altro che usare l'api ShellExecute
come si farebbe in vb....
good coding!!!
-- 
Damiani Liborio Igor
ig...@igordamiani.it
 - 
soft...@igordamiani.it
 - 
idam...@hotmail.com
http://www.igordamiani.it
ICQ : 11847262

 ha scritto nel messaggio
news:4E%5b.27246$R32.8...@news2.tin.it...

Ugo
scusami per l'OT, ma sono un dilettante e non sempre riesco a capire i
confini netti che separano i differenti settori di discussione all'interno
della grande famiglia "Informatica".
Ti ringrazio comunque per per avermi risposto in maniera molto approfondita
e ricca di riferimenti culturali preziosi.
Ciao - Daniele

 scusami per l'OT
Complimenti per il quoting.
Alberto

 good coding!!!
Questo è il mio Autorun.Inf
[AUTORUN]
open=ESP0INST.EXE
icon=ESP0INST.EXE
PS: ESP0INST.EXE è scritto in VB, non in C. Ovvio, anche se non usa (anzi,
non deve usare!) controlli particolari, ha bisogno del runtime di VB
(MSVB...60...DLL) che il buon java ebbe occasione di dire "basta metterlo
nella root del CD"

 ha scritto nel messaggio
news:bja0ug$gni6k$1...@ID-134521.news.uni-berlin.de...

Igor
Ti ringrazio per la tua gentile risposta.
Ciao - Daniele

 nella root del CD"
Yes.
fatto anch'io diverse volte.
butti via 1 megotto abbondante di spazio sulla root del cd, ma eviti grane e
ci metti quel che ti pare senza scomodare il c.
ciao
ugo

sě, questo lo sono, ma secondo me avete tutti frainteso la richiesta di
Newsgroup....
lui chiedeva come lanciare un HTML e non un file exe......quello si sa....
anche Ugo mangini ha postato, ma non c'č alcun riferimento a come fare
l'autorun di una pagina html....o sbaglio?


ooopppsss, scusa, Ugo....
intendevo Ugo Mangini (M maiuscola)
mai mancare di rispetto ad un membro onorario del NG!!!!
:-)))


 good coding!!!
mmm, vuoi dire che nella pappardella non si pala della "ShellExecute"... ?
Ok, rimedio:
(ciao
ugo)
Autorun.inf Commands
This document is a reference for the commands that you can use in an
Autorun.inf file.
[AutoRun] commands:
Icon
Label
Open
ShellExecute
Shell
Shell\Verb
[DeviceInstall] commands:
DriverPath
[AutoRun] Commands
Icon
The icon command specifies an icon which represents the AutoRun-enabled
drive in the Microsoft® Windows® user interface.
icon=iconfilename[,index]
Parameters
iconfilename
Name of an .ico, .bmp, .exe, or .dll file that contains the icon
information. If a file contains more than one icon, you must also specify a
zero-based index of the icon.
Remarks
The icon, together with the label, represents the AutoRun-enabled drive in
the Windows user interface. For instance, in Windows Explorer, the drive is
represented by this icon instead of the standard drive icon. The icon's file
must be in the same directory as the file specified by the open command.
The following example specifies the second icon in the MyProg.exe file.
icon=MyProg.exe,1
Label
The label command specifies a text label which represents the
AutoRun-enabled drive in the Windows user interface.
label=LabelText
Parameters
LabelText
A text string that contains the label. It can contain spaces.
Remarks
The label, together with an icon, represents the AutoRun-enabled drive in
the Windows user interface.
The following example specifies "My Drive Label" as the drive's label.
label=My Drive Label
Open
The open command specifies the path and file name of the application that
AutoRun launches when a user inserts a disc in the drive.
open=[exepath\]exefile [param1 [param2] ...]
Parameters
exefile
Fully qualified path of an executable file that runs when the CD is
inserted. If only a file name is specified, it must be in the drive's root
directory. To locate the file in a subdirectory, you must specify a path.
You can also include one or more command line parameters to pass to the
startup application.
Remarks
For more information about startup applications, see Tips for Writing
AutoRun Startup Applications.
ShellExecute
Version 5.0. The shellexecute command specifies an application or data file
that AutoRun uses to call ShellExecuteEx.
shellexecute=[filepath\]filename[param1, [param2]...]
Parameters
filepath
A string that contains the fully-qualified path of the directory that
contains the data or executable file. If no path is specified, the file must
be in the drive's root directory.
filename
A string that contains the file's name. If it is an executable file, it is
launched. If it is a data file, it must be a member of a file class.
ShellExecuteEx launches the default command associated with the file class.
paramx
Contains any additional parameters that should be passed to ShellExecuteEx.
Remarks
This command is similar to open, but it allows you to use file association
information to run the application.
Shell
The Shell command specifies a default command for the drive's shortcut menu.
shell=verb
Parameters
verb
The verb that corresponds to the command. The verb and its associated
command must be defined in the Autorun.inf file with a shell/verb command.
Remarks
When a user right-clicks the drive icon, a shortcut menu appears. If an
Autorun.inf file is present, the default shortcut menu command is taken from
it. This command executes when the user double-clicks the drive's icon.
To specify the default shortcut menu command, first define its verb, command
string, and menu text with shell/verb. Then use shell to make it the default
shortcut menu command. Otherwise, the default menu item text is "AutoPlay",
which launches the application specified by the open command.
Shell\Verb
The shell\verb command adds a custom command to the drive's shortcut menu.
shell\verb\command=Filename.exe
shell\verb=MenuText
Parameters
verb
The command's verb. The shell\verb\command command associates the verb with
an executable file. Verbs must not contain embedded spaces. By default, verb
is the text that displays in the shortcut menu.
Filename.exe
The path and file name of the application that performs the command.
MenuText
This parameter specifies the text that is displayed in the shortcut menu. If
it is omitted, verb is displayed. MenuText can be mixed-case and can contain
spaces. You can set a shortcut key for the menu item by putting an ampersand
(&) in front of the letter.
Remarks
When a user right-clicks the drive icon, a shortcut menu appears. Adding
shell/verb commands to the drive's Autorun.inf file allows you to add
commands to this shortcut menu.
There are two parts to this command, which must be on separate lines. The
first part is shell/verb/command. It is required. It associates a string,
called a verb, with the application to launch when the command runs. The
second part is the shell/verb command. It is optional. You can include it to
specify the text that displays in the shortcut menu.
To specify a default shortcut menu command, define the verb with shell/verb,
and make it the default command with shell.
The following sample Autorun.inf fragment associates the readit verb with
the command string "Notepad abc\readme.txt". The menu text is "Read Me", and
'M' is defined as the item's shortcut key. When the user selects this
command, the drive's abc\readme.txt file opens with Notepad.
shell\readit\command=notepad abc\readme.txt
shell\readit=Read &Me
[DeviceInstall] Commands
DriverPath
The DriverPath command specifies a directory to search recursively for
driver files. This command is used during a driver installation and is not
part of an AutoRun operation. The [DeviceInstall] section is only supported
under Microsoft® Windows® XP.
[DeviceInstall]
DriverPath=directorypath
Parameters
directorypath
A path to a directory that Windows searches for driver files, along with all
of its subdirectories.
Remarks
Do not use drive letters in directorypath as they change from one computer
to the next.
To search multiple directories, add a DriverPath command for each directory
as in this example.
[DeviceInstall]
DriverPath=drivers\video
DriverPath=drivers\audio
To indicate that the media contains no driver files so that it is not
searched at all, include a [DeviceInstall] section in Autorun.inf that
contains no DriverPath commands.

 mai mancare di rispetto ad un membro onorario del NG!!!!
per stavolta sei perdonato, la prossima... giro di chiglia con java
attaccato alle caviglie!
;-)
ciao
ugo
p.s. "onorario"? Quale onore...

 attaccato alle caviglie!
oops... attaccat"A"...
(mai mancare di rispetto alla "presidentessa onoraria"...  ;-)  )
ciao
ugo
ps... avevo anche dimenticato l'OT...

non ho capito.....Java attaccata alle caviglie?!?!? che significa?
è qualche creatura di cui non sono a conoscenza? è un pinguino?


 è qualche creatura di cui non sono a conoscenza? è un pinguino?
Attento!
Non svegliare il labrador che dorme... !
;-)
ciao
ugo

 è qualche creatura di cui non sono a conoscenza? è un pinguino?
Java=Canide (Labrador)
Javalab = Il suo (presunto, ma chiaramente illuso perchè in casa comanda
certamente Java) capobranco. Ominide.

 certamente Java) capobranco. Ominide.
Non mi pare, a dire il vero, che Pal abbia mai nemmeno "tentato" di
assumenre il ruolo di capobranco.
Penso sia rassegnato al comando di J, che, oltre che canide, è anche
femmina!       ;-)
...tu, secondo canide del ng, che ne pensi?   ;)
ciao
ugo

grazie a tutti e due per il chiarimento....
grande Java, anche io ho un cane.....
:-)))
piccolino, ma ce l'ho.....Jolly si chiama......
ora capisco tutti i riferimenti a Java nei post post-meeting (scusate il
gioco di parole).......
:-))))
adesso che mi fate pensare, mi sembra di aver visto qualche foto "cagnolosa"
nelle foto dei meeting....
io pensavo fosse il cane del proprietario del ristorante o qualche cane
trovato per caso durante il ritrovo.....
adesso ho capito tutto, mi avete aperto un nuovo mondo!!!!
grazie, good coding!!!


 ...tu, secondo canide del ng, che ne pensi?   ;)
Selvatico, canide selvatico che ha perso il suo indispensabile branco. Non
si vede? :-(

> Si puň avviare una pagina html con lo stesso procedimento? Come?
cosě:
open= explorer pagina.htm
ciao

 "cagnolosa" nelle foto dei meeting....
Appunto. Mai potuto scambiare/litigare un osso con lei, prima perchè non
c'ero io, poi perchè non c'era lei/lui. :-(
Ma la speranza è l'ultima a morire. Appropo': Ottobre è vicino.

"JtS" <JtS_N...@PLEASE.it> ha scritto nel messaggio
news:bja4po$64m$1...@gusp.infogroup.it...

Non so come ti chiami ma ti battezzo "Virgilio".
....e infine uscimmo a riveder le stelle.
A parte gli scherzi, ti ringrazio per l'illuminante suggerimento.
Ciao - Daniele

 ....e infine uscimmo a riveder le stelle.
ehmmmm... mi permetto di eccepire:
open=
deve essere usato per lanciare un exe
shellexecute=
va usata per un documento associato.
oppure, naturalmente, puoi usare un exe che esegua la shellexecute.
ciao
ugo

 A parte gli scherzi, ti ringrazio per l'illuminante suggerimento.
Veramente tra i vari post di questo thread ci sono dei consigli decisamente
migliori...
Ciao
--
Math Parser : 
http://www.neodatatype.net
Sito Comune : 
http://www.it-lang-vb.net