AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein *.bat Datei wird nicht richtig ausgeführt
Thema durchsuchen
Ansicht
Themen-Optionen

*.bat Datei wird nicht richtig ausgeführt

Ein Thema von Ykcim · begonnen am 11. Feb 2010 · letzter Beitrag vom 12. Feb 2010
 
hathor
(Gast)

n/a Beiträge
 
#4

Re: *.bat Datei wird nicht richtig ausgeführt

  Alt 11. Feb 2010, 16:33
Teste mal das:
Delphi-Quellcode:
    {Execute batch file}
    StrPCopy(Templine, 'temp.bat');
    TaskHandle := ShellExecute(frmMain.Handle, NIL, 'command.com',
                  templine,
                  Tempdir,
                  SW_MINIMIZE);

//and monitor it with a function like this:

    function CheckTask(hInstance: WORD): Boolean;
    var
        TaskInfo: TTASKENTRY;
        RetVal: Boolean;
    begin
        TaskInfo.dwSize := SizeOf(TTASKENTRY);
        RetVal := FALSE;
        if(TaskFirst(@TaskInfo)) then
        begin
            repeat
                if(TaskInfo.hInst = hInstance) then
                begin
                    RetVal := TRUE;
                    Break;
                end;
            until (TaskNext(@TaskInfo) = FALSE);
        end;
        CheckTask := RetVal;
    end;

(*This runs down the task list, trying to find the task with the specified
Hinstance, returning true if it is still there. To use this function,
simply call it in a loop like this*)


    while CheckTask(TaskHandle) do
    begin
        Application.ProcessMessages;
    end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:17 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