X

How to Execute PowerShell Scripts Without Pop-Up Window

PowerShell scripts are hard to run without any kind of popup. Without using the small workaround that I will show you here, it may even be impossible. Even if you specify the -WindowStyle Hidden switch - this will only result in the PowerShell window blinking up for a split second and disappearing afterward.

You can circumvent this issue by launching the PowerShell script from a small VBScript which looks as follows:

command = "powershell.exe -nologo -command C:\Users\howtoforge\Desktop\loop.ps1"
set shell = CreateObject("WScript.Shell")
shell.Run command,0

Save the script as .vbs file. The -command switch is followed by the location of your PowerShell script - give the full path here (my PS script is on C:\Users\howtoforge\Desktop and is called loop.ps1). This VBS frame will cause the PowerShell script to work silently; it will no longer display any cmd window.

Categories: Windows Windows 7
CSch:
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings