Autor Beitrag
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 26.07.07 11:52 
Hallo,

ich muss wissen, wie ich den Buchstaben ermitteln kann, den das CD-/DVD-Laufwerk besitzt, in dem die CD eingelegt ist, von der das Programm startet...


Moderiert von user profile iconChristian S.: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Do 26.07.2007 um 15:33
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 26.07.07 12:13 
Wenn das Programm nur von CD startet nimm doch einfach das erste Zeichen von Application.ExePath :)

AXMD
passiv
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 270

WIN XP Professional
Delphi 7 Enterprise, Java (Eclipse), Python 2.5, Django 1.1
BeitragVerfasst: Do 26.07.07 12:15 
bei paramstr(0) kommt auch der komplette pfad und dateiname der .exe raus

_________________
Die Probleme, die es in der Welt gibt, sind nicht mit der gleichen Denkweise zu lösen, die sie erzeugt hat.
Albert Einstein
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 26.07.07 12:57 
danke, es heißt aber Application.ExeName
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Do 26.07.07 14:17 
ParamStr(0) = Application.ExeName;
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 26.07.07 14:43 
ich habs einfach so gemacht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Path := Application.ExeName;
  Path := Copy(Path, 1, Pos('SPCD', Path) - 1);
  Path := Path + 'EXE\Programm.exe';
  ShellExecute(Handle, 'open', PChar(Path), nil, nil, SW_SHOW);

das ist auch sehr nützlich für Installationsprogramme
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 26.07.07 15:29 
Hallo,

etwas kürzer:
ausblenden Delphi-Quelltext
1:
2:
3:
ShellExecute(Handle,'open',
             PChar(ExtractFilePath(paramstr(0)+'EXE\Programm.exe'),
             nil, nil, SW_SHOW);

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 26.07.07 15:39 
achja, den ExtractFilepath hab ich gar nicht bedacht...