Windows XP Community - XPHeads



calling cmd.exe file with arguments

microsoft.public.windowsxp.general


Reply
  #1 (permalink)  
Old 04-14-2008, 12:17 PM
czechboy
 
Posts: n/a
calling cmd.exe file with arguments
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-14-2008, 12:40 PM
ju.c
 
Posts: n/a
Re: calling cmd.exe file with arguments
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" <oldrich.svec@centrum.cz> wrote in message
news:2d4d3b6f-08f3-4e01-aa20-530437222c37@f36g2000hsa.googlegroups.com...
> 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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-14-2008, 12:42 PM
Pegasus \(MVP\)
 
Posts: n/a
Re: calling cmd.exe file with arguments

"czechboy" <oldrich.svec@centrum.cz> wrote in message
news:2d4d3b6f-08f3-4e01-aa20-530437222c37@f36g2000hsa.googlegroups.com...
> 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.ex e" "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.ex e" "a test"


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-14-2008, 01:28 PM
czechboy
 
Posts: n/a
Re: calling cmd.exe file with arguments
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.ex e" 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.ex e" "a"
"test" > "C:\Program Files\FindAndRunRobot\Plugins\TodoTXT\temp.tmp"

If I try

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

todo.exe treats it badly...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-14-2008, 01:40 PM
czechboy
 
Posts: n/a
Re: calling cmd.exe file with arguments
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-14-2008, 01:59 PM
czechboy
 
Posts: n/a
Re: calling cmd.exe file with arguments
Finaly solved
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-14-2008, 06:14 PM
someone watching
 
Posts: n/a
and the answer is?
enlighten us!
___
"czechboy" <oldrich.svec@centrum.cz> wrote in message
news:b1701082-c777-45b0-bcb7-bc76b8df7c79@u3g2000hsc.googlegroups.com...
> Finaly solved



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-21-2008, 10:00 PM
ernperkins
 
Posts: n/a
Re: calling cmd.exe file with arguments

I'm having the same exact problem. What was the solution?

Thanks,
Ed Perkins


--
ernperkins
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-21-2008, 10:10 PM
Pegasus \(MVP\)
 
Posts: n/a
Re: calling cmd.exe file with arguments

"ernperkins" <ernperkins@msn.com> wrote in message
news:ernperkins.3bdku7@no-mx.tabletquestions.com...
>
> 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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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



All times are GMT. The time now is 12:04 AM.


Registry Mechanic - Free Scan Now
Driver Scanner 2009 - Free Scan Now




Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74