DaveLipman
(Fresh Scripter)
2019-10-24 03:43 PM
Run Program minimized

I want to be able to RUN a program but have it be minimized and not maximized.

Presently when I use RUN ("prog.exe") the program runs maximized. How can I RUN the program so that that it loads minimized or once it has loaded maximized, minimize it ?


AllenAdministrator
(KiX Supporter)
2019-10-24 05:33 PM
Re: Run Program minimized

It will likely require using start. If you go to a cmd prompt and type start /? you will get all the parameters, but /MIN is likely the one you are looking for.

Something like:
shell '%comspec% /c start /MIN program.exe'


DaveLipman
(Fresh Scripter)
2019-10-24 06:18 PM
Re: Run Program minimized

Perfect !

Xiexie ni.


AndreLuiz
(Getting the hang of it)
2019-10-24 07:12 PM
Re: Run Program minimized

[Pt-br]
Olha tinha uma udf por aqui que ela fazia isso, mas infelizmente não estou encontrando.
Mas você pode fazer o seguinte, eu até acho melhor usar assim:

[Eng(Google Translate)]
Look there was a udf around here that she was doing this, but unfortunately I'm not finding it.
But you can do the following, I even think it's better to use it like this:
 Code:
By default it is minimized!
execRun("cmd.exe", '/c echo ola mundo') ;or execRun("cmd.exe")


Function execRun($prog, optional $args, optional $title, optional $cfg, optional $nv_process)
	if ($cfg = 1)
		$cfg = "/max"
	else
		$cfg = "/min"
	endif
	select
		case ($nv_process = 0)
			$nv_process = "/LOW"
		case ($nv_process = 1)
			$nv_process = "/ABOVENORMAL"
		case ($nv_process = 2)
			$nv_process = "/BELOWNORMAL"
		case ($nv_process = 3)
			$nv_process = "/HIGH"
		case ($nv_process = 4)
			$nv_process = "/REALTIME"
		case 1
			$nv_process = "/NORMAL"
	Endselect
	Run '%comspec% /c start '+$nv_process+' '+$cfg+' "'+$title+'" %comspec% /k ""'+$prog+'" $args"'
EndFunction


DaveLipman
(Fresh Scripter)
2019-10-24 08:59 PM
Re: Run Program minimized

Obrigado.