Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Betriebssysteme (https://www.delphipraxis.net/27-betriebssysteme/)
-   -   Autostart bei USB-Stick????? (https://www.delphipraxis.net/35098-autostart-bei-usb-stick.html)

geisi 2. Dez 2004 16:18


Autostart bei USB-Stick?????
 
Kann ich auch einen Autostart bei einem usb-stick über autorun.inf machen?
danke im voraus

BenjaminH 2. Dez 2004 16:23

Re: Autostart bei USB-Stick?????
 
Ja, funktioniert meines Wissens nach genauso wie bei CD's

nailor 2. Dez 2004 16:27

Re: Autostart bei USB-Stick?????
 
probiers doch einfach aus [ot]ich bin genauso faul wie du[/ot]

geisi 2. Dez 2004 16:34

Re: Autostart bei USB-Stick?????
 
wie muas i do die autorun.inf schreibn, dass z.B. die Datei Project1.exe automatisch gestartet wird?

littlemike1005 2. Dez 2004 16:41

Re: Autostart bei USB-Stick?????
 
@geisi

schau es dir doch von einer cd ab. ist doch immer das gleiche schema.

gsh 2. Dez 2004 16:50

Re: Autostart bei USB-Stick?????
 
ein paar nette Beispiele:

am Anfang immer:
Code:
[autorun]
Automatisch starten:
Code:
open=setup.exe
Icon bei CD (Stick) laden
Code:
icon=icon.ico
Bei rechts klick auf CD (vieleicht auch bei Stick) wird es hinzugefügt:
Code:
shell\setup=Text in der liste
shell\setup\command=setup.exe
Ich bin mir sicher es gibt noch mehr aber die haben mir bis jetzt immer gereicht.


gsh

SirThornberry 2. Dez 2004 17:18

Re: Autostart bei USB-Stick?????
 
Also wir hamm letztens einen USB-Stick probiert bei dem der Autostart nicht funktioniert hat. Als wir den gesammten Inhalt des USB-Sticks in einen ordner auf der Festplatte kopiert haben und diesem mit Subst auf ein Laufwerk gemounted haben hat der Autostart funktioniert - Auf dem USB-Stick allerdings nicht :cry:

geisi 2. Dez 2004 17:21

Re: Autostart bei USB-Stick?????
 
danke für die beiträge! werd mal schaun obs funktioniert!

mh166 3. Dez 2004 11:33

Re: Autostart bei USB-Stick?????
 
Ich habe folgende zwei interessante Artikel im MSDN gefunden:

:arrow: Autorun.inf Entries
:arrow: How to test Autorun.inf Files

Vielleicht hilfts ja. :)

mfg, mh166

mh166 3. Dez 2004 16:59

Re: Autostart bei USB-Stick?????
 
Hmm... wer weiß. Vielleicht kann ja Chackotay helfen. Der hatte bereits das selbe Problem. *fragend rüber schaut*

mfg, mh166

The-X 3. Dez 2004 20:53

Re: Autostart bei USB-Stick?????
 
gab es da nicht einen Registry-Eintrag der festlegt für welche Laufwerke AutoRun aktiv ist ?

Code:
'Declaration of some constants
DRIVE_UNKNOWN=1   'Bit 0
DRIVE_NO_ROOT=2   'Bit 1
DRIVE_REMOVABLE=4 'Bit 2 
DRIVE_FIXED=8     'Bit 3 
DRIVE_REMOTE=16   'Bit 4 
DRIVE_CDROM=32    'Bit 5 
DRIVE_RAMDISK=64  'Bit 6 
DRIVE_FUTURE=128  'Bit 7 

sPathValue="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun"

'Called when the Plugin is started
SUB Plugin_Initialize
 i=RegReadValue(sPathValue)
 if IsEmpty(i)=true then
    i=145
 end if

 if IsNumeric(i)=false then
    Call MsgWarning("The current AutoPlay feature settings in your registry are in an incorrect form (REG_BINARY instead of REG_DWORD). These values will be ignored and the default values, as they are out of the box, will be displayed.")
    i=145
 end if


 'TH: Looks stupid, I know! but there is no way to get OR working with variants!
 'AK: JScript ||. Should work

 dim b1,b2,b3,b4,b5,b6,b7
 i=OrHelper(i,DRIVE_FUTURE,b1)
 i=OrHelper(i,DRIVE_RAMDISK,b2)
 i=OrHelper(i,DRIVE_CDROM,b3)
 i=OrHelper(i,DRIVE_REMOTE,b4)
 i=OrHelper(i,DRIVE_FIXED,b5)
 i=OrHelper(i,DRIVE_REMOVABLE,b6)
 i=OrHelper(i,DRIVE_NO_ROOT,b7)


 '//If the bit is set, AutoRun is DISABLED
 Call SetBox(b3,1)
 Call SetBox(b6,2)
 Call SetBox(b5,3)
 Call SetBox(b4,4)
END SUB

Function OrHelper(CurValue,CheckVal,CheckValSet)
 i=CurValue

 if i>=CheckVal then
    CheckValSet=true
    i=i-CheckVal
 else
    CheckValSet=false
 end if

 OrHelper=i
End Function

Sub SetBox(CurVal,Elm)
    if CurVal=true then
       SetUIElement elm,false
    else
       SetUIElement elm,true
    end if
End Sub


'Called when the Plugin should validate the Data the user has entered
SUB Plugin_CheckData(ElementIndex)
END SUB

'Called when the Plugin should apply the changes
SUB Plugin_Apply(ElementIndex,ElementSubIndex)
 i=0

 'Always disable autorun for the following drives
 'according to Q136214 from MS KB
 i=i+DRIVE_UNKNOWN
 i=i+DRIVE_FUTURE
 '//Needed??? i=i+DRIVE_NO_ROOT


 'No let's see what the user wants
 if GetUIElement(1)=false then i=i+DRIVE_CDROM
 if GetUIElement(2)=false then i=i+DRIVE_REMOVABLE
 if GetUIElement(3)=false then i=i+DRIVE_FIXED
 if GetUIElement(4)=false then i=i+DRIVE_REMOTE


 Call RegWriteValue(sPathValue,i,2)
 Call Logoff()
END SUB

'Called when the Plugin is about to be removed from memory
SUB Plugin_Terminate
END SUB
Das ist das Script aus XTeq-XSetup dazu

mh166 3. Dez 2004 21:38

Re: Autostart bei USB-Stick?????
 
Zitat:

Zitat von The-X
gab es da nicht einen Registry-Eintrag der festlegt für welche Laufwerke AutoRun aktiv ist ?

Du hast dir die Links von mir nicht wirklich angeschaut, oder? :gruebel: Sonst hättest du ja merken müssen, dass der zweite Link genau diesen Schlüssel erklärt. :warn:

mfg, mh166

The-X 3. Dez 2004 21:45

Re: Autostart bei USB-Stick?????
 
:roll: Sorry, aber ich les auch nich alles :roll:


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:04 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz