vladimir100

ShellExecute with Parameters

6 posts in this topic

I have a OpenDs.vbs script (VBScript) that I'm running from the command windows as

OpenDs "Crumble Adoc (admin)\Initial Top Level Collection A"

If I use

ShellExecute("C:\AutoIt Scripts\OpenDs.vbs","Crumble Adoc (admin)\Initial Top Level Collection A")

it displays the message box with the word "Crumble" meaning that it terminates the parameter at the first space.

If I use

ShellExecute("C:\AutoIt Scripts\OpenDs.vbs")

it runs VBScript but without the parameter.

How to run the script with one parameter that has spaces?

I appreciate any help on this subject.

Thanks,

Vladimir

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

ShellExecute('Your Program.exe', '"Your Parameters with Spaces"')

Notice the single quotes outside the double quotes

Edited by Varian

Share this post


Link to post
Share on other sites

ShellExecute('Your Program.exe', '"Your Parameters with Spaces"')

Notice the single quotes outside the double quotes

Thank you. It works.

Share this post


Link to post
Share on other sites

HI All,

Appreciate its been a while since any activity on this topic.. However I am experiencing a similar issue as described 

The parameter doesn't seem to be recognized, This throws up the Windows Installer menu,, implying the switch is invalid

I have tried using a variety of combinations using '"/x"' "/x" ""/x"" '/x'

ShellExecute($source & "\APP\" & $APPMSI,'"/x"')

Any help would be most appreciated.

Share this post


Link to post
Share on other sites

Looking at your posted code it seems you are running an MSI?

How does the working commandline  look when shelled from the CMD prompt? 

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hi Jos

Thanks for getting back to me, 

Yes this is installing an MSI

This is how it looks in the command windows

app.msi, /x,E:\Temp\apppath\" /qn

Just to add the MSI works fine manually, it also works if I use Runwait

 

Many thanks

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