YFridman Posted January 15, 2019 Posted January 15, 2019 Can someone explain why the following command is not running from within AutoIT, yet, the next line is running fine from the command prompt? In both cases Run As Administrator is being used. RunWait(@ComSpec & ' /c ' & 'powershell -executionpolicy bypass -command "import-startlayout -layoutpath '\\server\netlogon\LogOn\Win10Config\start1703.xml' -mountpath $env:systemdrive\"',"C:\windows\system32",@SW_HIDE) powershell -executionpolicy bypass -command "import-startlayout -layoutpath '\\server\netlogon\LogOn\Win10Config\start1703.xml' -mountpath $env:systemdrive\" I tried to run @comspec with '/k' and @SW_SHOW, but got nothing but a blank dos screen. Thank you.
Developers Jos Posted January 15, 2019 Developers Posted January 15, 2019 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted January 15, 2019 Developers Posted January 15, 2019 Replace the /c with a /h while testing and you should be able to see the error message in the cmd window. I do believe you have atleast an issue with the single quotes in the command. maybe this is better: (untested) RunWait(@ComSpec & ' /c ' & 'powershell -executionpolicy bypass -command "import-startlayout -layoutpath ''\\server\netlogon\LogOn\Win10Config\start1703.xml'' -mountpath $env:systemdrive\"',"C:\windows\system32",@SW_HIDE) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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