Technology Questions 

 

Go Back   Technology Questions > Software Questions > Operating System Questions > Windows XP

Windows XP Discuss the Microsoft Windows XP Operating System

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 04-14-2008, 04:20 AM
czechboy
Newsgroup Contributor
 
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

 
Old 04-14-2008, 04:20 AM
  #2 (permalink)  
Old 04-14-2008, 04:40 AM
ju.c
Newsgroup Contributor
 
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, 04:50 AM
Pegasus \(MVP\)
Newsgroup Contributor
 
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, 05:30 AM
czechboy
Newsgroup Contributor
 
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, 05:50 AM
czechboy
Newsgroup Contributor
 
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, 06:00 AM
czechboy
Newsgroup Contributor
 
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, 10:20 AM
someone watching
Newsgroup Contributor
 
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, 02:00 PM
Registered User
 
Join Date: Jun 2008
Posts: 1
ernperkins is on a distinguished road
Re: calling cmd.exe file with arguments

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

Thanks,
Ed Perkins
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #9 (permalink)  
Old 06-21-2008, 02:10 PM
Pegasus \(MVP\)
Newsgroup Contributor
 
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:
calling cmd.exe file with arguments


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

Reply

Bookmarks

Thread Tools

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Command Line arguments??? Jenna Windows Vista 11 09-09-2007 02:50 AM
DCOM starts services "with arguments" (LOL) FlutterBy Windows Vista 1 06-22-2007 06:30 AM
Calling an MVP janet-m Windows XP 17 06-20-2007 11:40 AM
XP problem passing command arguments with spaces Ron G Windows XP 3 01-21-2007 07:30 AM
Passing command line arguments Cornel Gligan Pocket PC General 2 01-15-2007 09:53 AM


New To Technology Questions? Do You Need Help?

All times are GMT -8. The time now is 07:56 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0