views:

73

answers:

1

When using start /max program_name to start a bunch programs, how to focus on each program when it opens. For now, it open focus on the first program, and launch others on the back. thanks.

OS: Windows Server 2003

Program: any windows program, like notepad

PS. It will focus on newly opened program on Windows XP SP3, but not Windows server 2003.

A: 

I haven't been able to find a way to use the start command for this behavior, but if you can use a powershell script instead of a .bat file, here is the code to start a new process maximized and always pop up to the front:

$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.Filename = "notepad.exe"
$psi.Arguments = ""
$psi.WindowStyle = 3
[System.Diagnostics.Process]::Start($psi)

Just fill in the Filename and Arguments and you're good to go.

My first thought was to use rundll32 to call Shell32.dll's ShellExecute, but it look like it needs parameters that I can't type from the commandline, such as a reference to the parent window.

BrianCumminger