locked
Finding the right powershell to set Execution Policies? RRS feed

  • Question

  • So, I wrote some hta, that calls vbs, that calls powershell Script.

    Now, there are two ways around it:

    1) I need to set the execution policy of my powershell to unrestricted to run those scripts. Now, there seem to be 2 powershells in windows: the one I, the user open and the one that vbs calls upon. When I change the execution policy in the powershell I can call, vbs opens another powershell and tells me it can't execute scripts. When I check, execution policy is still set to unrestricted. So: how do I fix this? (aka: Where do I find the "right" powershell to set execution policy?

    2) I guess I can sign my script, somehow, so windows recognizes it as "save"? How whould I do this? (As this would be the better option^^)

    Wednesday, October 5, 2016 8:54 AM

Answers

  • It is very hard to understand what you are doing.

    If you are on a 64 bit system then there are two versions of PowerShell.

    Open PowerShell by typing [windowsKey]-R and type PowerShell.

    In PowerShell type  "Set-ExecutionPolicy RemoteSigned"

    Now type  "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Powershell"

    Then type  "Set-ExecutionPolicy RemoteSigned"

    Now both versions are set the same way.


    \_(ツ)_/

    • Marked as answer by Jan Witt Wednesday, October 5, 2016 9:49 AM
    Wednesday, October 5, 2016 9:13 AM

All replies

  • It is very hard to understand what you are doing.

    If you are on a 64 bit system then there are two versions of PowerShell.

    Open PowerShell by typing [windowsKey]-R and type PowerShell.

    In PowerShell type  "Set-ExecutionPolicy RemoteSigned"

    Now type  "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Powershell"

    Then type  "Set-ExecutionPolicy RemoteSigned"

    Now both versions are set the same way.


    \_(ツ)_/

    • Marked as answer by Jan Witt Wednesday, October 5, 2016 9:49 AM
    Wednesday, October 5, 2016 9:13 AM
  • Hi Jan,

    The vbs might be getting executed by any other user's context.

    verify the user which is able to execute the powershell, is the same user executing vbs

    Please click Mark As Answer if my post helped you


    J.B.Patnaik

    • Marked as answer by Jan Witt Wednesday, October 5, 2016 9:49 AM
    • Unmarked as answer by Jan Witt Wednesday, October 5, 2016 9:50 AM
    Wednesday, October 5, 2016 9:14 AM