Elisabeth
Elisabeth

Reputation: 21226

How can I run a powershell script from startup/autostart folder with bat file?

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

Answers (1)

Bill_Stewart
Bill_Stewart

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

Related Questions