PC Review


Reply
Thread Tools Rate Thread

calling cmd.exe file with arguments

 
 
czechboy
Guest
Posts: n/a
 
      14th Apr 2008
Hi,
I have the following code:

C:\WINDOWS\system32\cmd.exe /C "C:\Program Files\FindAndRunRobot
\Plugins\TodoTXT\dist\todo.exe a test"

I want to call todo.exe with a parameter "a test". How to do it
correctly?
Thank you
Oldrich Svec
 
Reply With Quote
 
 
 
 
ju.c
Guest
Posts: n/a
 
      14th Apr 2008
Do you want the command window to stay open?

cmd.exe /C Carries out the command specified by string and
then terminates

cmd.exe /K Carries out the command specified by string but
remains


Your quote is in the wrong place. Only quote the path, not
switches.

C:\WINDOWS\system32\cmd.exe /C "C:\Program Files\FindAndRunRobot
\Plugins\TodoTXT\dist\todo.exe" a test


ju.c



"czechboy" <(E-Mail Removed)> wrote in message
news:2d4d3b6f-08f3-4e01-aa20-(E-Mail Removed)...
> Hi,
> I have the following code:
>
> C:\WINDOWS\system32\cmd.exe /C "C:\Program Files\FindAndRunRobot
> \Plugins\TodoTXT\dist\todo.exe a test"
>
> I want to call todo.exe with a parameter "a test". How to do it
> correctly?
> Thank you
> Oldrich Svec


 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      14th Apr 2008

"czechboy" <(E-Mail Removed)> wrote in message
news:2d4d3b6f-08f3-4e01-aa20-(E-Mail Removed)...
> Hi,
> I have the following code:
>
> C:\WINDOWS\system32\cmd.exe /C "C:\Program Files\FindAndRunRobot
> \Plugins\TodoTXT\dist\todo.exe a test"
>
> I want to call todo.exe with a parameter "a test". How to do it
> correctly?
> Thank you
> Oldrich Svec


You have a couple of options:

- The simple way:
"C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\dist\todo.exe" "a test"
(There is no need to invoke an extra Command Processor)

- Making life harder for yourself:
C:\WINDOWS\system32\cmd.exe /C "C:\Program
Files\FindAndRunRobot\Plugins\TodoTXT\dist\todo.exe" "a test"


 
Reply With Quote
 
czechboy
Guest
Posts: n/a
 
      14th Apr 2008
Thank you for your answer. I want to call a program from jscript by
oShell.Run(command, 0, true) The problem I have now is that if the
following

"C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\dist\todo.exe" a
test > "C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\temp.tmp"

is my "command" variable then it treats ">" as another parameter for
todo.exe, but I want to output the result into the temp.tmp file.

The same is with:

"C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\dist\todo.exe" "a"
"test" > "C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\temp.tmp"

If I try

"C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\dist\todo.exe" "a
test" > "C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\temp.tmp"

todo.exe treats it badly...
 
Reply With Quote
 
czechboy
Guest
Posts: n/a
 
      14th Apr 2008
I have even tried

C:\WINDOWS\system32\cmd.exe /C "C:\Program Files\FindAndRunRobot
\Plugins\TodoTXT\dist\todo.exe" a skola > "C:\Program Files
\FindAndRunRobot\Plugins\TodoTXT\temp.tmp"

and it works when called from xplorer2, but it doesnt work when called
from jscript.. I am quite lost
 
Reply With Quote
 
czechboy
Guest
Posts: n/a
 
      14th Apr 2008
Finaly solved
 
Reply With Quote
 
someone watching
Guest
Posts: n/a
 
      14th Apr 2008
enlighten us!
___
"czechboy" <(E-Mail Removed)> wrote in message
news:b1701082-c777-45b0-bcb7-(E-Mail Removed)...
> Finaly solved



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      21st Jun 2008

"ernperkins" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I'm having the same exact problem. What was the solution?
>
> Thanks,
> Ed Perkins
>
>
> --
> ernperkins


I assume you're referring to a thread that is more than two months
old. Since you removed all of the original text, it is not possible to
be sure. Have a look here - maybe this is what you're after:
http://www.technologyquestions.com/t...arguments.html


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub calling and passing arguments Jacob Microsoft Excel Programming 2 28th Sep 2006 05:56 PM
Sub calling and passnig arguments Jacob Microsoft Excel Programming 2 28th Sep 2006 04:51 PM
Calling C# from VB.Net with arguments by reference =?Utf-8?B?dGFuZHltYW4=?= Microsoft Dot NET 1 11th Aug 2005 08:11 AM
CAlling Excel MAcro with arguments bmm Microsoft Excel Discussion 0 3rd Aug 2004 04:18 PM
calling New with arguments - Syntax question Colin McGuire Microsoft VB .NET 4 16th Nov 2003 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:13 PM.