Sign in to follow this  
Followers 0
DataKruncher

Run Function, ShellExecute

3 posts in this topic

Using the Run Function to open Windows Mail. Run("C:\Program Files\Windows Mail\WinMail.exe") Using: Run("WinMail.exe") didn't work for me. In the help example for the Run function to open NotePad, no path is used: Run("Notepad.exe", "", @SW_MAXIMIZE). I couldn't get Windows Mail to open without the path. I searched this site for help on the Run Function and the ShellExecute Function, but didn't see any topics with those function names. So I thought I'd post something. I'm still not sure what the optional 'workingdir' parameter for the Run function is good for. I tried putting the path to Windows mail in the 'workingdir' parameter for the Run function and I had no luck with it. If anyone has some good tips for using the Run and ShellExecute functions I'd really like to know what they are.

Share this post


Link to post
Share on other sites



Try using a FileExist() to make sure your getting the path right. From my experience (I'm not sure about this but it worked for me), the Working Dir is necessary if the .exe you are trying to run accesses files from the folder it is in.


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
The Run Function and the ShellExecute function don't pause for an application to load before running subsequent lines of script. So if, for example, there was a line of script to enter a user ID name into a login box after the Run command, the script would be trying to enter the login ID before the login box ever came up. So use WinWaitActive to pause the script until the window you want to have the script work, on comes up. That works well. There is also a RunWait and a ShellExecuteWait function that waits until the program finishes before running more script. But I tried the RunWait function to open Windows Mail, and The rest of my script NEVER ran. So obviously there must be a difference between when the application is done LOADING, and when it is done RUNNING. So RunWait wasn't useful to me for putting in a user ID and password into the application login box. Run, run run run run. I'm sure this is all just very basic knowledge to experienced users, but I couldn't find this information in the forum or at the wiki page.

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