Jump to content

import-startlayout PS command not running from AutoIT - (Moved)


Recommended Posts

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.

Link to post
Share on other sites
  • Developers

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.
  :)

Link to post
Share on other sites
  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...