Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I run an .exe with command line arguments.

5,943 views
Skip to first unread message

Saucer Man

unread,
Apr 14, 2008, 2:43:41 PM4/14/08
to
I need to run an .exe with arguments like

this.exe address: 192.168.168.100 logfile: c:\logfile.log


How can I do this?

--
Thanks!


Pegasus (MVP)

unread,
Apr 14, 2008, 2:53:29 PM4/14/08
to

"Saucer Man" <sauc...@nospam.com> wrote in message
news:4803a5dc$0$19796$cc2e...@news.uslec.net...

Your question is a little unclear. Which of the following to
you mean:
- Run an .exe file by itself?
- Invoke it from within a bach file?
- Invoke it from within a VB Script file?

If it is the last one, have you looked at the "exec" and "run"
methods of the WScript.Shell object?


Saucer Man

unread,
Apr 15, 2008, 8:03:03 AM4/15/08
to

"Pegasus (MVP)" <I....@fly.com.oz> wrote in message
news:eFdwVDmn...@TK2MSFTNGP04.phx.gbl...

>
>>
> Your question is a little unclear. Which of the following to
> you mean:
> - Run an .exe file by itself?
> - Invoke it from within a bach file?
> - Invoke it from within a VB Script file?
>
> If it is the last one, have you looked at the "exec" and "run"
> methods of the WScript.Shell object?
>
>
I was looking to invoke it from a VBScript. I think I need a (two) pairs of
quotes around the actual path and .exe and then a set of quotes around the
whole thing. Like this...

"""c:\program files\test.exe"" -address 10.1.2.3"


Tom Lavedas

unread,
Apr 15, 2008, 8:54:13 AM4/15/08
to

You also need the Run or the Exec method to 'shell out' to the command
environment ...

with createobject("wscript.shell")
.run """c:\program files\test.exe"" -address 10.1.2.3", 0, true
end with
wsh.echo "Done"

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

Saucer Man

unread,
Apr 16, 2008, 11:35:22 AM4/16/08
to
Ok. Thanks!


"Tom Lavedas" <tglb...@cox.net> wrote in message
news:904fece6-198b-41e5...@b1g2000hsg.googlegroups.com...

0 new messages