Sign in to follow this  
Followers 0
ClayB

CMD Question

6 posts in this topic

I am new to AutoIt and I am sorry if this question has already been addressed elsewhere but I couldn't find it. What I am trying to do is to create a script that will run a cmd prompt with elevated privileges. First off, I am a domain admin and domain admins are administrators on the test machine. I have tried runas and that hasn't worked for me (might simply be a syntax problem, not sure). Would you mind posting some snippets with how you deal with this issue? BTW, the test machine is Win 7 x64 Enterprise. Eventually this will be deployed using SCCM so I need the script to elevate the privileges on it's own and, eventually, silently.

Thanks

Clay

Share this post


Link to post
Share on other sites



I need the script to elevate the privileges on it's own and, eventually, silently.

:blink:

Share this post


Link to post
Share on other sites

By the lack of response I can deduce one of two things either (1) this gets asked all the time and nobody wants to respond or (2) there is no way in the programs current state to do this. Would someone mind cluing me in so I can either look harder or quit looking all together.

Share this post


Link to post
Share on other sites

If you're already running in the Domain Admin's security context, you don't need additional perms. Don't SSCM tasks run (or can be configured to run) in that context?

:blink:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you're already running in the Domain Admin's security context, you don't need additional perms. Don't SSCM tasks run (or can be configured to run) in that context?

:blink:

I was trying to get the script to run without adding the complexity of SCCM but, now that you mention it, SCCM may be the way to go. I will reimage the computer and try it out. Out of curiosity, is there a way to code the permissions into the script?

Edit

Oh and I was getting permission errors when running it. I will double check permissions on the image when it finishes it's imaging.

Edited by ClayB

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

The error I am getting is

Error: 0xC004F025 Access denied: the requested action requires elevated privileges.

When I right click and "run as administrator" I don't get the error. So I need the script to run as administrator.

**Edit**

Never mind, looks like #RequireAdmin fixed it.

Edited by ClayB

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  
Followers 0