Jump to content

Recommended Posts

Posted

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.

Posted

#RequireAdmin wont work if you dont have admin rights.

You can try:

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

Posted (edited)

#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
Posted

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.

Posted

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

Posted

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?

Posted

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

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
×
×
  • Create New...