SU command in ms cmd prompt

Status
Not open for further replies.

babaton

Solid State Member
Messages
10
Hi,

Can anyone help me?

I have a batch script that alters a registry setting,problem is it needs to run on a machine where the user does not have admin rights.

When the script runs the registry change is denied.

SO - How do I use the su command?

if i do :su username
I get :password?

Obviously the user doesn't know the admin password and I'm not gonna tell him.

So how do I feed the password into the script and keep it hidden.
Whats the syntax?

Many thanks.
 
Nope,

no matter what I put after su I get a prompt for password.

The syntax for the su comand is :

su <user> "cmdline" [domain] [winsta\]desktop] [options]

No mention of password there.

I know It can be done as I have done it before but can't remember how.
I know that I referenced a file with the password in it.

Cheers.
 
so it's asking for the password, and you know what it is but you don't want to tell him, he doesn't have to know you can type it in

put in "su username" press enter
then put in password then enter
it should work
 
Yeah,well obviously that would be cool except its not just one user its more like 20 and the script runs on login so I'm not gonna be around to type in admin passwords for everyone all day.

come on some one must have seen it done....
 
Status
Not open for further replies.
Back
Top Bottom