Jump to content
Sign in to follow this  

ShellExecute with current dir specified

Recommended Posts



I often use ShellExecute to run any .exe, but I'm surprised of that :

ShellExecute("conf.exe", "", @ScriptDir)

With XP, it don't run "conf.exe" into @ScriptDir but run conf.exe of "C:\Program Files\NetMeeting"...

Dir specified into ShellExecute command in not with and higher priority ?

Thanks a lot :mellow:

Edited by Amour

Share this post

Link to post
Share on other sites

Third parameter doesn't says anything about where to find the program, only what the workdir is of the shelled application.

Use fully qualified filenames in the first parameter if you want to be explicit.

ShellExecute ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] )


filename The name of the file to run (EXE, .txt, .lnk, etc). 
parameters [optional] Any parameters for the program. Blank ("") uses none. 
workingdir [optional] The working directory. Blank ("") uses the current working directory. 
verb [optional] The "verb" to use, common verbs include:
  open = Opens the file specified. The file can be an executable file, a document file, or a folder
  edit = Launches an editor and opens the document for editing. If "filename" is not a document file, the function will fail
  print = Prints the document file specified. If "filename" is not a document file, the function will fail
  properties = Displays the file or folder's properties
  See remarks for more information on the default behavior when a verb is not specified. 
showflag [optional] The "show" flag of the executed program:
  @SW_HIDE = Hidden window
  @SW_MINIMIZE = Minimized window
  @SW_MAXIMIZE = Maximized window
Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

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