Hi,
Can I run a shortcut in hidden mode? I only see the option "normal window", "minimized" and "Maximized".
We have a few powershell scripts and the script will start an application. I want to run the powershell script in hidden mode and that the powershell script runs / shows the application.
Grtz,
Pieter
Did you try the -windowstyle parameter for powershell.exe?
For example:
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -file c:\temp\test.ps1
Depending on your environment you may also need to add the -executionpolicy parameter for powershell.exe.
Are you directly referring to powershell in the shortcut?
Did you try the "start" command? You can open a command prompt and type "start /?" to see the available parameters.
Yes, the shortcut points directly to powershell.
I did not try start, but I can't use it (not sure), because "start" is a command built into the CMD shell. So I have no idea how to use start to run a hidden powershell window.
Did you try the -windowstyle parameter for powershell.exe?
For example:
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -file c:\temp\test.ps1
Depending on your environment you may also need to add the -executionpolicy parameter for powershell.exe.
Hi Pieter,
Can I run a shortcut in hidden mode? I only see the option "normal window", "minimized" and "Maximized".
I'm aware that this does not provide a solution to your real question, but just for completeness: DEM supports the same options as Windows itself.
We have a few powershell scripts and the script will start an application. I want to run the powershell script in hidden mode and that the powershell script runs / shows the application.
Maybe combining Run: Minimized on the (DEM) shortcut (to limit the visibility of PowerShell's console window flashing by) with Ivan's -WindowStyle Hidden suggestion does the trick?
Hi,
Did you try the -windowstyle parameter for powershell.exe?
Now I tried. I still see 1 sec. a black screen, but I don't see code. When I minize this screen it's acceptable.
Thank you for your answer!
I'm aware that this does not provide a solution to your real question, but just for completeness: DEM supports the same options as Windows itself.
Yes, I understand. But by the product we use at the moment, this is an option . We are going to use the option which Ivan suggested..
So does that product that should not be named let you create Windows shortcuts that launch their target hidden? Interesting...