I have a Windows Server 2008 box. I have run, as administrator, in powershell Set-ExecutionPolicy Unrestricted. When I run powershell Get-ExecutionPolicy
, it returns Unrestricted.
I have created a .bat file which exhibits the issue I am seeing. The .bat file, test.bat, is only one line, powershell Get-ExecutionPolicy
. When I open command prompt and run test.bat, "Unrestricted" is printed to the screen.
If I run the following python script however,
import subprocess
subprocess.Popen("test.bat")
"Restricted" is printed to the screen. How is this setting different when being run from Python's subprocess.Popen? I am not seeing the issue on a Windows 7 machine I have, where I have performed an identical workflow.