Jump to content
Sign in to follow this  
hot202

Run as admin

Recommended Posts

hot202

ok i have a prob i have made a script so that i click lunch to open a game but the game needs to run in admin to work

is there away that i cam make it run the program that it launches to launch as admin this is what im using

Case $msg = $StartGame
            $Location = IniRead("C:\Location.ini", "Game Location", "dir", "")
            Run($Location & "\Game.exe")

i have tryed to add #RequireAdmin but thats dont work.

Share this post


Link to post
Share on other sites
Juvigy

#RequireAdmin wont work if you dont have admin rights.

You can try:

RunAs($user, "$domain or computername", $pass,0,@ScriptName,@ScriptDir)

Share this post


Link to post
Share on other sites
hot202

#RequireAdmin wont work if you dont have admin rights.

You can try:

RunAs($user, "$domain or computername", $pass,0,@ScriptName,@ScriptDir)

i do have admin rights and will RunAs work on other computers? Edited by MrParo

Share this post


Link to post
Share on other sites
Juvigy

RunAs($user, "$domain or computername", $pass,0,@ScriptName,@ScriptDir)

That line starts your script with another account rights.

If your account doesnt have admin rights on the other computer it wont work.

Share this post


Link to post
Share on other sites
hot202

yeah but i dont want to put my accounts in it if im going to give the program to other people and then it wont run as admin on there computers

Share this post


Link to post
Share on other sites
Juvigy

So it wont work as admin then if the other guys dont have admin rights.

Share this post


Link to post
Share on other sites
hot202

every1 will have admin rights. u know how when u right click on a program and chose run as admin isnt there away to to that with a code like run?

Share this post


Link to post
Share on other sites
Juvigy

I dont understand. If they are admins , what is the problem?

Everything should be fine with the admin rights.

Share this post


Link to post
Share on other sites
hot202

thanks anyway guys but i got it working another way i just made the program to make a shortcut and then the programruns the shortcut

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  

×