mr-es335 Posted Friday at 02:18 PM Posted Friday at 02:18 PM Good day, I hope that the day finds you all very well! I have been experiencing major issues with regards to executing .ps1 script within AutoIt in Windows 10 LTSC!! I finally discover that "tucked away in the background" , was an error message stating, "...running scripts is disabled on this system...". This was discovered after some 1-2 hours of wondering why my script was NOT executing as expected! • See this: [Click_Me] ...and this... [Click_Me] Here is the original script... ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- ExcludeMe() ; ----------------------------------------------- Func ExcludeMe() Local $sPS1Script = "D:\Install\OS\Scripts\ExcludeMe.ps1" ; ----------------------------------------------- Run('powershell.exe -File ' & '"' & $sPS1Script & '"', "", @SW_HIDE) EndFunc ;==>ExcludeMe ; ----------------------------------------------- ...and here is the updated script... ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- ExcludeMe() ; ----------------------------------------------- Func ExcludeMe() Local $sPS1Script = "D:\Install\OS\Scripts\ExcludeMe.ps1" ; ----------------------------------------------- Run('powershell.exe -ExecutionPolicy Bypass -File ' & '"' & $sPS1Script & '"', "", @SW_HIDE) EndFunc ;==>ExcludeMe ; ----------------------------------------------- All that was required was the addition of the parameter, "-ExecutionPolicy Bypass"!! "WOW!!!" I must admit that I was rather surprised...that it would appear...that no one else was experiencing this issue!! I hope this information will be of some practicable employment? mr-es335 Sentinel Music Studios
argumentum Posted Friday at 04:39 PM Posted Friday at 04:39 PM 2 hours ago, mr-es335 said: I must admit that I was rather surprised...that it would appear...that no one else was experiencing this issue!! Not an issue, a feature. Otherwise one can run a malicious .ps1 without knowing. Shouldn't be used unless by the owner of the PC willingly does it. Safety first. mr-es335 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
mr-es335 Posted Saturday at 08:40 PM Author Posted Saturday at 08:40 PM argumentum, Thanks for the clarification...Yes, indeed! Your comment..."Not an issue, a feature...." is very apropos here! Thansk! mr-es335 Sentinel Music Studios
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now