draycon
Goto Top

USB - Autorun kopieren von Dateien

Hallo,

ich bin gerade an einem kleinen Projekt am arbeiten - Das Problem kommt etwas später, ich erkläre erst mal was ich genau mache zur Zeit.

Ich habe einen USB-Stick so bearbeitet, dass er beim einstecken 2 Laufwerke mountet.

1. den Stick an sich
2. ein imaginäres CD-Rom Laufwerk auf dem eine Iso Datei aufgespielt ist

Auf der Iso habe ich die autorun.inf und eine Batch Datei.

Ich möchte mit dieser Batch Datei, welche durch den Autostart im CD-Rom Laufwerk geöffnet wird Dateien vom PC auf den Stick kopieren.

@ECHO OFF
IF NOT EXIST \Backup MD \Backup
IF NOT EXIST \Backup\%Computername% MD \Backup\%Computername%
xcopy c:\*BILD*.* G:\Backup\%Computername% /I /Y /S /Q
xcopy c:\*BILD*.* G:\Backup\%Computername% /I /Y /S /Q
exit


Nun zum eigentlichen Problem:

Der Laufwerkbuchstabe des Sticks ist bei mir G und das CD-Rom Laufwerk hat bei mir den Buchstaben E. Auf anderen Computern wird aber anders zugewiesen, sodass G ein anderes Laufwerk ist.

Wenn ich in der Batchdatei nicht speziell G hin schreibe, will er auf das CD-Rom Laufwerk schreiben. Durch %~d0 wird nur der Buchstabe des Laufwerks auf dem die Batch läuft erkannt.

1. Wie kann ich den Laufwerkbuchstaben des Sticks feststellen und dann auf ihm schreiben?
2. Mir wird der Zugriff in einigen Ordnern verweigert, wie kann ich alles als Admin ausführen lassen?

Content-Key: 313458

Url: https://administrator.de/contentid/313458

Printed on: April 16, 2024 at 06:04 o'clock

Member: StefanKittel
StefanKittel Aug 24, 2016 at 21:55:21 (UTC)
Goto Top
Mitglied: 129813
129813 Aug 25, 2016 updated at 06:54:07 (UTC)
Goto Top
Autorun on USB Media without manual user interaction is disabled by default on windows os since decades ....

Regards
Member: Cornitus
Cornitus Aug 25, 2016 at 11:29:29 (UTC)
Goto Top
Hi,

das Programm unter anderem User laufen lassen müsste hiermit klappen: https://technet.microsoft.com/de-de/library/cc771525(v=ws.10).aspx

VG
Member: draycon
draycon Aug 28, 2016 at 15:10:42 (UTC)
Goto Top
Schon mal danke für die Antworten bisher.

Kann man es irgendwie realisieren, dass ich die Batch Datei als Admin ausführe, ohne, dass das Passwort abgefragt wird?
Wenn ich Daten mit z.B. Namensbestandteil "bild" auf meinen USB-Stick kopieren möchte, die sich in meinen Persönlichen Ordnern befinden. Das funktioniert nämlich irgendwie nicht.

Wenn ich Programme mit Admin-Rechten ausführe drücke ich doch auch immer nur auf "Ja" und gebe kein Passwort ein.
Mitglied: 129813
129813 Aug 28, 2016 updated at 17:38:15 (UTC)
Goto Top
Create a task to run your app (schtasks), and activate the "run with highest privileges" option.
Das funktioniert nämlich irgendwie nicht.
I know, the error is 50cm in front of your desk :-p
You should read more about the security model in windows than poking and trying in the dark my friend.

As I said autorun from USB will not work on any current device anymore (Microsoft decided this because of security reasons).
Get a BAD-USB-Device which simulates an input device, this is the only reliable way to autostart apps on any windows device, not only the ones you prepared to do so.
Member: draycon
draycon Aug 28, 2016 at 21:55:12 (UTC)
Goto Top
It already fails on the chipset needed... face-big-smile
Phison USB 3.0 with PS2251-03 (2303) controller.

They are really rare I found out. And every other chipset is not working with. It's really a shame there is no other supported chipset or other possibilities.

It is really important to build such a stick or something similar for me. I'm a student and it is a project and the topic is accompanied by law enforcement.

But thank you for your reply!