Sign in to follow this  
Followers 0
Mingre

Windows run function? [RESOLVED]

7 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Apparently, there's this _RunDOS function I overlooked. LOL.

Sorry guys, it's my no-thinking-before-asking week. Problem solved.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Sorry guys, it's my no-thinking-before-asking week. Problem solved.

Should I ask any of the moderators to revoke posting permission for a week? :huh2: It can be arranged.

Share this post


Link to post
Share on other sites

Should I ask any of the moderators to revoke posting permission for a week? :huh2: It can be arranged.

LOL. Please just leave the decision to the moderators.

Thanks! Haha.

Share this post


Link to post
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
Sign in to follow this  
Followers 0