Jump to content
legend

How to run "run"

Recommended Posts

legend

I need to run "run", same thing as when you press windows + R. "run" does not create a new process, so i'm a little unsure how to launch it,

besides sending keys such as windows + R

 

 

Udklip.PNG

Share this post


Link to post
Share on other sites
TheDcoder

Don't know if it works in other versions of Windows but I tested it in Windows 8.1:

ShellExecute(@UserProfileDir & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run')

 


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
legend

that works, thanks :)

Share this post


Link to post
Share on other sites
Chimp

also

Send("#r")

 


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
TheDcoder

@Chimp

1 hour ago, legend said:

besides sending keys such as windows + R


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
Chimp

.... ok.... :)


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
badcoder123

Also

Run("C:\WINDOWS\system32\rundll32.exe shell32.dll,#61")

 

  • Like 2

Share this post


Link to post
Share on other sites
TheDcoder

@badcoder123 Nice! Should be more universal than my solution :)

  • Like 1

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
JLogan3o13

Or, as AutoIt contains both a Run and a ShellExecute function you could make your script more efficient, bypass the Run box altogether, and save yourself a couple of lines.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
taylansan
5 hours ago, badcoder123 said:

Also

Run("C:\WINDOWS\system32\rundll32.exe shell32.dll,#61")

 

Just two questions for leaning: 

1. Why did you call shell32? Why not another dll? 

2. What does #61 stand for? Such as I tried with #62 (to test) and nothing happens. And where do you get a list of this? 

Edited by taylansan

TY.

Share this post


Link to post
Share on other sites
taylansan

Similar to the original question, how can I perform other operations such as: 

  • Windows + L = to lock the computer
  • Windows + P = to switch to the projector

Besides sending keys... If I call shell32 again, which function # would it be? 


TY.

Share this post


Link to post
Share on other sites
JLogan3o13

@taylansan Google is your friend. A simple search of "Shell32 dll functions list" returns everything you would want to know.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
taylansan
5 minutes ago, JLogan3o13 said:

@taylansan Google is your friend. A simple search of "Shell32 dll functions list" returns everything you would want to know.

Thanks brother, I did check the list of functions and searched for the keywords such as "lock" or "projector", but couldn't find any proper. 

http://www.geoffchappell.com/studies/windows/shell/shell32/api/index.htm

Yet, I'm asking it for learning way, how to know which function it would be.


TY.

Share this post


Link to post
Share on other sites
iamtheky

literally search for "command to lock windows"

https://www.google.com/search?q=command+to+lock+windows

I imagine the first return is going to look eerily similar to @badcoder123's solution.  Or use the spoiler.

 

rundll32.exe user32.dll, LockWorkStation


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
badcoder123
8 hours ago, taylansan said:

Similar to the original question, how can I perform other operations such as: 

  • Windows + L = to lock the computer
  • Windows + P = to switch to the projector

Besides sending keys... If I call shell32 again, which function # would it be? 

Run("C:\WINDOWS\system32\rundll32.exe user32.dll, LockWorkStation") 
;or
Run("rundll32.exe user32.dll, LockWorkStation")

 

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

×