wie gehts. folgendes geht auf jeden fall nicht:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8:
| Dir:String; SetLength(Dir,254); GetSystemDirectory(@Dir[1], Length(Dir)); WinExec(PChar(Dir+'cmd.exe'),sw_show); ShellExecute(Application.Handle, 'open', PChar(Dir+'cmd.exe'), nil, nil, sw_ShowNormal); |
bisher hatte ich immer dieses
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8:
| BATCHFILE := TStringlist.Create; BATCHNAME := 'Temp.bat'; BATCHFILE.add('@echo off'); BATCHFILE.add('%COMSPEC%'); BATCHFILE.add('del %0');
BATCHFILE.SaveToFile(BATCHNAME); WinExec(PChar(BATCHNAME),sw_show); |
das funzt zwar, aber es bleibt die temp.bat wenn man nicht mit exit beendet. und das muß nicht sein
Moderiert von
Gausi: Code- durch Delphi-Tags ersetzt.Moderiert von
Tino: Topic aus Sonstiges verschoben am Mo 14.02.2005 um 09:19