# Auto run of PS Script

**URL:** <https://forums.powershell.org/t/auto-run-of-ps-script/10471>\
**Category:** PowerShell Help\
**Created:** [April 8, 2018, 11:39pm UTC](https://forums.powershell.org/t/auto-run-of-ps-script/10471 "2018-04-08T23:39:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![j2sankha](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@j2sankha](https://forums.powershell.org/u/j2sankha)\
**Post date:** [April 8, 2018, 11:39pm UTC](https://forums.powershell.org/t/auto-run-of-ps-script/10471/1 "2018-04-08T23:39:12Z")

</div>

Hi Team,  
Need an assistance for auto executing PowerShell script (ps1). I know that for security reason PS scripts are not run automatically, but yet if you find any way out please guide me.  
I tried using batch file, but it’s failed actually. The batch file opening the prompt of PowerShell but after that nothing executed. I’m planning for creating a schedule task, but yet feeling that will not work.  
So if any of you find any tricks for the same, please let me know.  
Thanks in Advance.  
Regards,  
Roy.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [April 9, 2018, 2:24am UTC](https://forums.powershell.org/t/auto-run-of-ps-script/10471/2 "2018-04-09T02:24:09Z")

</div>

That’s actually not a Powershell scripting issue. 😉 To run a Powershell script you should use a proper command line:

```
Powershell.exe -ExecutionPolicy Bypass -NoProfile -File “.ps1”
```

---

<div class="post-metadata">

**Author:** ![j2sankha](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@j2sankha](https://forums.powershell.org/u/j2sankha)\
**Post date:** [April 15, 2018, 9:27pm UTC](https://forums.powershell.org/t/auto-run-of-ps-script/10471/3 "2018-04-15T21:27:11Z")

</div>

Thanks, it works.

---

<div class="post-metadata">

**Author:** ![ta11ow](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/ta11ow/32/131_2.png) [@ta11ow](https://forums.powershell.org/u/ta11ow)\
**Post date:** [April 15, 2018, 10:15pm UTC](https://forums.powershell.org/t/auto-run-of-ps-script/10471/4 "2018-04-15T22:15:51Z")

</div>

Alternately, you can elect to change the execution policy to permit scripts to run.

```
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
```

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:35pm UTC](https://forums.powershell.org/t/auto-run-of-ps-script/10471/5 "2024-05-16T20:35:56Z")

</div>


