Reputation: 21226
Are those files put into a cmd context and then just executed/typed ? A .bat file is just run, but a powershell file can`t just be run.
How can I make it run without bat file?
Upvotes: 1
Views: 16677
Reputation: 24585
You don't need a batch file (.bat
or .cmd
file). Just create a shortcut to %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -File whatever.ps1
. You may need to use the -ExecutionPolicy
parameter to allow scripts. Run powershell /?
from a Cmd.exe or PowerShell prompt for more information.
Upvotes: 4