Jump to content

Recommended Posts

Posted

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?

Posted

 #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

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

Posted

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!

Posted
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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...