Recent

Author Topic: if Tprocess.options "poNoConsole", file does not execute  (Read 2170 times)

fbartra

  • New member
  • *
  • Posts: 8
if Tprocess.options "poNoConsole", file does not execute
« on: September 04, 2015, 06:51:54 pm »
If I use poNoConsole option, my file does not execute

code below:

  RunProgram := TProcess.Create(nil);
  RunProgram.options := RunProgram.options+[poNoConsole]; <-- if I comment this line, my code works.
  RunProgram.options := RunProgram.options+[poWaitOnExit];
  RunProgram.WaitOnExit;
  RunProgram.Executable := 'jpg.bat';
  RunProgram.Parameters.add(filename);
  RunProgram.Execute;

Thanks is advance

Fausto

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: if Tprocess.options "poNoConsole", file does not execute
« Reply #1 on: September 04, 2015, 07:32:59 pm »
Attempting to run a batch file without a console.... i don't believe that works.

You probably could solve that by running cmd.exe with the batch file as argument, but that leaves you with a shell window being opened again.

derek.john.evans

  • Guest
Re: if Tprocess.options "poNoConsole", file does not execute
« Reply #2 on: September 04, 2015, 07:38:09 pm »
Use:
Code: [Select]
RunProgram.ShowWindow := swoHIDE;       

 

TinyPortal © 2005-2018