CD5 Posted May 11, 2019 Author Posted May 11, 2019 afterburner is not running in the backaround and i think i know why, it would seem MSIAfterBurner reqires administrator to start , this may not work as i would invision it but could you run the script elevated so it can execute MSIAfterBurner?
supraaxdd Posted May 11, 2019 Posted May 11, 2019 (edited) Take a look at the RunAs() command. You will find more info there. Also look at #RequireAdmin Regards, Supra Edited May 11, 2019 by supraaxdd
CD5 Posted May 11, 2019 Author Posted May 11, 2019 #include <MsgBoxConstants.au3> #RequireAdmin If IsAdmin() Then MsgBox($MB_SYSTEMMODAL, "", "The script is running with admin rights.") While 1 If ProcessExists("msiafterburner.exe") Then MsgBox(0, "", "This program is already running.") Sleep(5000) Else RunAs ( "myusername", "", "mypassword","", "C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe") MsgBox(0, "", "This program wasn't running, we are starting it up right now.") Sleep(5000) EndIf WEnd heres what i have put together, the script runs in admin but afterburner is still not starting , perhaps you could make sure im useing runAs correctly but im not getting any errors. Thanks
supraaxdd Posted May 11, 2019 Posted May 11, 2019 6 minutes ago, CD5 said: #include <MsgBoxConstants.au3> #RequireAdmin If IsAdmin() Then MsgBox($MB_SYSTEMMODAL, "", "The script is running with admin rights.") While 1 If ProcessExists("msiafterburner.exe") Then MsgBox(0, "", "This program is already running.") Sleep(5000) Else RunAs ( "myusername", "", "mypassword","", "C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe") MsgBox(0, "", "This program wasn't running, we are starting it up right now.") Sleep(5000) EndIf WEnd heres what i have put together, the script runs in admin but afterburner is still not starting , perhaps you could make sure im useing runAs correctly but im not getting any errors. Thanks Try and take out the RunAs function and leave the #RequireAdmin. You are already logged on your admin account hence why you don't need to RunAs any other user. Also note that once you have the script running, have ONLY one open and if you want to close it, you will have to end it in the task manager because this loop is never ending. I would need to add a piece of code which makes it stop when the program is stopped. I might add a GUI which will be able to exit the whole program.
CD5 Posted May 11, 2019 Author Posted May 11, 2019 makeing the RunAs command the run one from before did the trick , everythings perfect #include <MsgBoxConstants.au3> #RequireAdmin If IsAdmin() Then MsgBox($MB_SYSTEMMODAL, "", "The script is running with admin rights.") While 1 If ProcessExists("msiafterburner.exe") Then MsgBox(0, "", "This program is already running.") Sleep(5000) Else Run("C:\Program Files (x86)\msi afterburner\msiafterburner.exe") MsgBox(0, "", "This program wasn't running, we are starting it up right now.") Sleep(5000) EndIf WEnd also figured out how to insert code so here is the working version, thanks for all the help!
supraaxdd Posted May 11, 2019 Posted May 11, 2019 1 minute ago, CD5 said: makeing the RunAs command the run one from before did the trick , everythings perfect #include <MsgBoxConstants.au3> #RequireAdmin If IsAdmin() Then MsgBox($MB_SYSTEMMODAL, "", "The script is running with admin rights.") While 1 If ProcessExists("msiafterburner.exe") Then MsgBox(0, "", "This program is already running.") Sleep(5000) Else Run("C:\Program Files (x86)\msi afterburner\msiafterburner.exe") MsgBox(0, "", "This program wasn't running, we are starting it up right now.") Sleep(5000) EndIf WEnd also figured out how to insert code so here is the working version, thanks for all the help! Alright! Hope you have a good time coding! Regards, Supra CD5 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now