Jump to content

Windows run function? [RESOLVED]


Recommended Posts

Hello AutoIt helpers,

Is there a way to open the Windows run without simulating Windows + 'r'? Or probably another way so that I can use the command line switches of some applications.

BTW, here's my script:

Send("{LWINDOWN}r")
    Send("{LWINUP}")

    Opt("SendKeyDelay", 0)

    $string = "sample string --command line"

    ClipPut($string)
    Controlsend("Run", "", "Edit1", "^v")
    Controlsend("Run", "", "Edit1","{ENTER}")

I use the ClipPut-and-paste method instead of control-sending the whole string because I'm afraid the string won't be sent accurately. (And it happened! My PC lagged for a while while executing the ControlSend() part, what happened was some of the characters were repeatedly sent.)

So back to my question, is there any other method available?

Thank you.

Edited by Lilbert
Link to comment
Share on other sites

$string = "sample string --command line"
Run($string)

I did try using that before but it didn't work until I realized just after you posted that I should've included the full path of the file. I was used to writing only the filename in the Windows run, so obviously my tests would fail me.

Thanks sir!

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