Jump to content
Sign in to follow this  
MElkins

How Do You Run Batch Jobs In Vista

Recommended Posts

MElkins

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.

Share this post


Link to post
Share on other sites
XIRAM

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

Share this post


Link to post
Share on other sites
XIRAM

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×