Jump to content

Recommended Posts

Posted

I've got an AutoScript that uses the RunAsWait command to run a batch job. The batch job works fine except for the NET STOP SPOOLER Command. It gives me an access denied error.

#RequireAdmin

RunAsWait("myuserid", "mydomain", $MyPassWrd, 0, $RunCmd, $CmdDir)

The batch command line that fails with Access Denied is:

REM # Stop/Start the spooler service

NET STOP SPOOLER

NET START SPOOLER

If I run the batch job from Explorer using the Windows Run As Administrator prompt it works fine but not in AutoIt. I am using the latest version of AutoIt.

I would greatly appreciate any suggestion anyone might offer in helping me solve this.

  • 4 years later...
Posted

Hi,

Old thread but Exactly the same problem, that's driving me crazy, I just need it to finish my software.

Did you find a solution to that? Or someone else?

Thanks for the answer

Posted

Finally, I found a solution which is not perfect but works.

I replaced all my RunAsWait by RunWait, and put a #RequireAdmin in the top of the code. With that the spooler restart correctly...

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