Autor Beitrag
MagicRain
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

WinXp, Win8, iOS
Delphi 7, Lazarus Pascal, Delphi 10.2 Starter, NetBeans Java
BeitragVerfasst: Sa 04.05.13 04:52 
Hey ich möchte das was ich mit einer .Bat datei mache in delphi machen aber irgendwie hat das nicht so hin. Meine bat macht was sie soll aber mein delphi code nicht. Er öffnet zwar die exe's aber führt nichts aus mit der vmf datei....

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
@echo off
"C:\bin\vbsp.exe" "D:\wwdwdwd.vmf"
"C:\bin\vvis.exe" "D:\wwdwdwd.vmf"
"C:\bin\vrad.exe" "D:\wwdwdwd.vmf"
pause

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var
  x, y, z, q : String;
begin
  x := Edit1.text;
  y := Edit2.text; <<< dirs....
  z := Edit3.text;
  q := Edit4.text;

  shellexecute( 0nil, PChar('C:\bin\vbsp.exe'), PChar('D:\wwdwdwd.vmf'), nil, SW_Normal);
  shellexecute( 0nil, PChar('C:\bin\vvis.exe'), PChar('D:\wwdwdwd.vmf'), nil, SW_Normal);
  shellexecute( 0nil, PChar('C:\bin\vrad.exe'), PChar('D:\wwdwdwd.vmf'), nil, SW_Normal);


Vielleicht kann mir ja jemand helfen :)
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 04.05.13 05:24 
- Nachträglich durch die Entwickler-Ecke gelöscht -
MagicRain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

WinXp, Win8, iOS
Delphi 7, Lazarus Pascal, Delphi 10.2 Starter, NetBeans Java
BeitragVerfasst: Sa 04.05.13 06:11 
Geht leider auch nicht erführt die programme zwar aus also öffnet die aber übergibt die datei wohl irgendwie nicht. Und so passiert nichts die datei wird nicht converted. Komisch....:(

MfG
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: Sa 04.05.13 09:07 
Sind da evtl. Leerzeichen im Dateinamen? Dann musst Du diese wie in der *.bat auch in Anführungszeichen einschließen.
Mathematiker
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2622
Erhaltene Danke: 1448

Win 7, 8.1, 10
Delphi 5, 7, 10.1
BeitragVerfasst: Sa 04.05.13 09:29 
Hallo,
ich würde es einmal mit
ausblenden Delphi-Quelltext
1:
shellexecute(application.handle,'open', PChar('C:\bin\vbsp.exe'), PChar('D:\wwdwdwd.vmf'), PChar('D:\'),SW_SHOWNORMAL);					

versuchen.
Zumindest lasse ich mit
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
var exedatei,pdfdatei,ordner:pchar;
begin 
    getmem(exedatei,255);
    getmem(pdfdatei,255);
    getmem(ordner,255);
...
    strpcopy(ordner,tempstring);
    strpcopy(pdfdatei,tempstring+'xxx.pdf');
    findexecutable(pdfdatei,nil,exedatei);
    strpcopy(pdfdatei,'xxx.pdf');
    shellexecute(application.handle,'open',exedatei,pdfdatei,ordner,SW_SHOWNORMAL);
...
    freemem(exedatei);
    freemem(pdfdatei);
    freemem(ordner);
end;

PDF-Dateien anzeigen. Und es funktioniert.

Beste Grüße
Mathematiker

_________________
Töten im Krieg ist nach meiner Auffassung um nichts besser als gewöhnlicher Mord. Albert Einstein
MagicRain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

WinXp, Win8, iOS
Delphi 7, Lazarus Pascal, Delphi 10.2 Starter, NetBeans Java
BeitragVerfasst: Sa 04.05.13 15:30 
Danke euch! Wie immer super.... Da fehlten echt die "" :-O verdammt....C:\Program Files (x86).....leerzeichen :D

MfG
MagicRain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

WinXp, Win8, iOS
Delphi 7, Lazarus Pascal, Delphi 10.2 Starter, NetBeans Java
BeitragVerfasst: Sa 04.05.13 16:17 
Nun nur noch ein problem...Und zwar will ich die dirs ja nicht hardcoded machen sonder über Editfelder übergeben lassen bloß wenn ich das so versuche funktioniert das ganze wieder nicht.

ausblenden Delphi-Quelltext
1:
C:\Program Files (x86)\bin\vqsp.exe					

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
  x := Edit1.text; filepfad1
  y := Edit2.text; filepfad2
  z := Edit3.text; filepfad3
  q := Edit4.text; filepfad4

  shellexecute( 0'open', PChar('"x"'), PChar('"q"'), nil, SW_Normal);
  shellexecute( 0'open', PChar('"y"'), PChar('"q"'), nil, SW_Normal);
  shellexecute( 0'open', PChar('"z"'), PChar('"q"'), nil, SW_Normal);


Mach ich was falsch ?

MfG
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Sa 04.05.13 16:24 
ausblenden Delphi-Quelltext
1:
PChar('"' + Edit1.Text + '"')					

_________________
Wissenschaft schafft Wissenschaft, denn Wissenschaft ist Wissenschaft, die mit Wissen und Schaffen Wissen schafft. (myself)
MagicRain Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

WinXp, Win8, iOS
Delphi 7, Lazarus Pascal, Delphi 10.2 Starter, NetBeans Java
BeitragVerfasst: Sa 04.05.13 16:24 
Oh man danke!!!!!

MfG