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.