Jump to content

Running control panel apps...


koresho
 Share

Recommended Posts

Hey all. I want a program I am making to be able to launch control panel apps... like the power configuration page for example.

Here is how I am doing it now:

If $msg = $powerconfig Then
    $typerun = "powercfg.cpl" 
    $typeexecute = "RunCmd" 
    _run ($typerun, $typeexecute)
EndIf

Func _run($typerun, $typeexecute)
    If $typeexecute = "RunCmd"  Then
        Send ("#r")
        WinWaitActive ("Run")
        ClipPut($typerun)
        If @OSVersion = "WIN_VISTA"  Then Sleep (50)
        Send("^v")
        If @OSVersion = "WIN_VISTA"  Then Sleep (50)
        ControlClick ("Run", "", 1)
    EndIf
EndFunc  ;==>_run

Any better ideas? I want to avoid havign to script the Run box.

Link to comment
Share on other sites

Yes, ShellExecute works with some things like msconfig, cmd, chkdsk and such, Run works for stuff like "control admintools" or "control netconnections" but .cpl or .msc do not work for either command.

examples:

desk.cpl

inetcpl.cpl

diskmgt.msc

working examples:

Run("control netconnections")

ShellExecute("verifier")

Edit::

I Figured it out. Trial by elimination...

This does it:

Run(@ComSpec & " /c " & 'diskmgmt.msc', "", @SW_HIDE)

Yes i stole that line verbatim from the help file for "Run"

Edited by koresho
Link to comment
Share on other sites

Hi, you can try this

Run("control.exe main.cpl,@0,","",@SW_HIDE)

I suggest you check

http://www.autoitscript.com/forum/index.ph...;hl=Control.exe

Regards,

Eduardo.

Or call cpl file using ShellExecute

Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator

VW Bug user

Pinheiral (Pinewood) city:

http://pt.wikipedia.org/wiki/Pinheiral

Link to comment
Share on other sites

Edit::

Trial by elimination...

This does it:

Run(@ComSpec & " /c " & 'diskmgmt.msc', "", @SW_HIDE)

Yes i stole that line verbatim from the help file for "Run"

I appreciate the help, however I don't want to waste anyone's time with this topic anymore... <_<

That is how I did it.

Link to comment
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
 Share

  • Recently Browsing   0 members

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