Jump to content

How to run "run"


legend
 Share

Recommended Posts

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')

 

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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")

 

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