Changeset 502 for Common/UCommon.pas
- Timestamp:
- Jan 22, 2018, 11:01:57 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r493 r502 63 63 procedure OpenWebPage(URL: string); 64 64 procedure OpenFileInShell(FileName: string); 65 procedure ExecuteProgram( CommandLine:string);65 procedure ExecuteProgram(Executable: string; Parameters: array of string); 66 66 procedure FreeThenNil(var Obj); 67 67 function RemoveQuotes(Text: string): string; … … 112 112 Path := IncludeTrailingPathDelimiter(APath); 113 113 114 Find := FindFirst( UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);114 Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec); 115 115 while Find = 0 do begin 116 DeleteFile(Path + UTF8Encode(SearchRec.Name));116 DeleteFile(Path + SearchRec.Name); 117 117 118 118 Find := SysUtils.FindNext(SearchRec); … … 429 429 end; 430 430 431 procedure ExecuteProgram( CommandLine:string);431 procedure ExecuteProgram(Executable: string; Parameters: array of string); 432 432 var 433 433 Process: TProcess; 434 I: Integer; 434 435 begin 435 436 try 436 437 Process := TProcess.Create(nil); 437 Process.CommandLine := CommandLine; 438 Process.Executable := Executable; 439 for I := 0 to Length(Parameters) - 1 do 440 Process.Parameters.Add(Parameters[I]); 438 441 Process.Options := [poNoConsole]; 439 442 Process.Execute; … … 456 459 procedure OpenFileInShell(FileName: string); 457 460 begin 458 ExecuteProgram('cmd.exe /c start "' + FileName + '"');461 ExecuteProgram('cmd.exe', ['/c', 'start', FileName]); 459 462 end; 460 463
Note:
See TracChangeset
for help on using the changeset viewer.