1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32:
| function DeleteZeichen(s,z:string): string; begin if Pos(z,s)>0 then begin Delete(s,Pos(z,s),1); s:=DeleteZeichen(s,z); end; result:=s; end;
function DeleteParam(s:string):string; const Endungen : array[0..2] of string[4] = ('.exe','.bat','.com'); var t : string; a, b : Integer; begin s:=DeleteZeichen(s,'"'); t:=ExtractFileName(s); for a:=0 to 2 do begin b:=Pos(Endungen[a]+' ',LowerCase(t)); if b > 0 then begin t:=Copy(t,1,b+3); Break; end; end; result:=ExtractFilePath(s)+t; end; |