Delphi-PRAXiS
Seite 3 von 4     123 4      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Dos command (https://www.delphipraxis.net/167448-dos-command.html)

guinnes 30. Mär 2012 11:10

AW: Dos command
 
Hier gibts eine von Sirius überarbeitete Version von TDosCommand

value is NULL 30. Mär 2012 11:35

AW: Dos command
 
Zitat:

Zitat von guinnes (Beitrag 1159399)
Hier gibts eine von Sirius überarbeitete Version von TDosCommand

Das klingt gut... werds mal probieren

value is NULL 30. Mär 2012 11:43

AW: Dos command
 
also irgendwie krieg ichs nicht zum laufen ....
in dem Beispiel steht

Delphi-Quellcode:
var diskname: string;
      --
      DosCommand1.CommandLine := 'c:\myformat.bat a:';
      DosCommand1.Execute; //launch format process
      DosCommand1.SendLine('', True); //equivalent to press enter key
      DiskName := 'test';
      DosCommand1.SendLine(DiskName, True); //enter the name of the volume
Aber wenn ich die Unit einbinde bekomme ich bei DosCommand den CommandLine vorschlag nicht :/

guinnes 30. Mär 2012 12:05

AW: Dos command
 
Zitat:

Zitat von value is NULL (Beitrag 1159406)
Aber wenn ich die Unit einbinde bekomme ich bei DosCommand den CommandLine vorschlag nicht :/

Hast du das Ding als Komponente installiert und verwendest die Komponente, oder erzeugst du das Dingen im Quelltext ?
Delphi-Quellcode:
procedure TfrmTSMain.btnExecuteClick(Sender: TObject);
var
  Command : String;
begin
  if JvOpenDialog.Execute then
  begin
    RxTrackInfo.EmptyTable;
    JvOpenDialog.InitialDir := ExtractFilePath(JvOpenDialog.FileName);
    lbxFileList.Items.Add(JvOpenDialog.FileName);
    mmMeta.Lines.Clear;
    mmDosCommand.Lines.Clear;
    Command := ExtractFilePath(Application.ExeName) + 'tsmuxer "' + JvOpenDialog.FileName + '"';
    DosCommand.CommandLine := Command;
    DosCommand.Execute;
  end;
end;
Tut bei mir einwandfrei

value is NULL 30. Mär 2012 12:26

AW: Dos command
 
Zitat:

Zitat von guinnes (Beitrag 1159412)
Zitat:

Zitat von value is NULL (Beitrag 1159406)
Aber wenn ich die Unit einbinde bekomme ich bei DosCommand den CommandLine vorschlag nicht :/

Hast du das Ding als Komponente installiert und verwendest die Komponente, oder erzeugst du das Dingen im Quelltext ?
Delphi-Quellcode:
procedure TfrmTSMain.btnExecuteClick(Sender: TObject);
var
  Command : String;
begin
  if JvOpenDialog.Execute then
  begin
    RxTrackInfo.EmptyTable;
    JvOpenDialog.InitialDir := ExtractFilePath(JvOpenDialog.FileName);
    lbxFileList.Items.Add(JvOpenDialog.FileName);
    mmMeta.Lines.Clear;
    mmDosCommand.Lines.Clear;
    Command := ExtractFilePath(Application.ExeName) + 'tsmuxer "' + JvOpenDialog.FileName + '"';
    DosCommand.CommandLine := Command;
    DosCommand.Execute;
  end;
end;
Tut bei mir einwandfrei

ne ich habs als Unit in meiner commandline app eingebunden :/

guinnes 30. Mär 2012 12:40

AW: Dos command
 
Zitat:

Zitat von value is NULL (Beitrag 1159415)
ne ich habs als Unit in meiner commandline app eingebunden :/

Wie ?

value is NULL 30. Mär 2012 12:48

AW: Dos command
 
Habe die Unit in meinen Libary Ordner gepackt und in die Uses eingebunden.

LG

guinnes 30. Mär 2012 12:53

AW: Dos command
 
Zitat:

Zitat von value is NULL (Beitrag 1159421)
Habe die Unit in meinen Libary Ordner gepackt und in die Uses eingebunden.

Und das Objekt erzeugt und die nötigen Eventhandler geschrieben und angebunden ?

Klaus01 30. Mär 2012 12:53

AW: Dos command
 
.. bin mir nicht sicher aber ist TDosCommand nicht eine Klasse?
.. hast Du davon eine Instanz erzeugt?

Delphi-Quellcode:
dosCommand := TDosCommand.create;
Grüße
Klaus

value is NULL 30. Mär 2012 13:09

AW: Dos command
 
Zitat:

Zitat von Klaus01 (Beitrag 1159424)
.. bin mir nicht sicher aber ist TDosCommand nicht eine Klasse?
.. hast Du davon eine Instanz erzeugt?

Delphi-Quellcode:
dosCommand := TDosCommand.create;
Grüße
Klaus

Alles klar.. funktioniert!!!

ich teste mal die Unit !


LG


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:02 Uhr.
Seite 3 von 4     123 4      

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