dejhost Posted July 28, 2015 Posted July 28, 2015 (edited) Dear Ladies, dear Gentlemen.I would like to call a self-written program ("Main.exe"), using the command ShellExecute().$program = "Main.exe" ShellExecuteWait(@ScriptDir & "\" & $program)The commands above work fine. But the "Main.exe" expects additional parameters and as soon as I add them$program = "Main.exe" Local $path1 = "C" Local $path2 = "Users\Albert Einstein\Desktop\test" Local $path3 = "DSC01505" Local $path4 = ".JPG" Local $path5 = _PathMake ( $path1, $path2, $path3, $path4 ) ShellExecute(@ScriptDir & "\" & $program & " " & $path5)I receive an errormessage by windows: "Windows cannot find...", followed by the string. The message continuous: "Make sure you've typed the name correctly, then try again.".Google-ing this problem, I think there is something wrong with the spaces between the parameters. So I triedShellExecute(@ScriptDir & "\" & $program & ' "' & $path5 & '"')and instead of "$path5" I typed the string by manually - but all attempts produce the same error message.When I use the command "run" instead of "ShellExecute", I do not have this problem. Somebody experienced the same problem (http://www.vbforums.com/showthread.php?733507-RESOLVED-Cannot-make-ShellExecute-work!) and solved it:Function RunProgram mFile = mid(document.activeElement.innerText, 3) Set objShell = CreateObject("Shell.Application") objShell.ShellExecute """" & mfile & """" set objShell = nothing End FunctionBut I actually do not understand the the """"-part. Could somebody enlighten me, please?Thanks so much!dejhost Edited July 28, 2015 by dejhost path to image in second code section contained an error.
jguinch Posted July 28, 2015 Posted July 28, 2015 The first parameter of ShellExecute is the program path. The 2nd parameter contain the additionnal parameters (typically, $path5) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
dejhost Posted July 28, 2015 Author Posted July 28, 2015 hi jguinch,please don't tell anyone... thanks so much!dejhost
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now