Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++ 2005
|
Visual C++ 2005 For discussion of Visual C++ 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 27th, 2008, 07:03 PM
Registered User
 
Join Date: Dec 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default start .exe and use an option

Hi community,

Can someone tell me how to open a .exe in the background and choose option 1 in the Program?
I just want that i can start this programm without typing 1 allways.

When i open the Programm he geaves me a choice:

-Press [1] to start
-Press [2] to close

Is it possible? Searched at google didnt find the right one.
I also tryied it with a .bat file,

start "test123" "C:\Documents and Settings\manu\Desktop\test\test\tet.exe "

But dont know how to choose 1.

Please help me this would be so amazing.

Best regards and sorry for my bad english
 
Old December 29th, 2008, 03:46 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

try using the following at the command prompt

c:\>test.exe < 1

i think it should work

thanks
 
Old December 29th, 2008, 04:18 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by zeronexxx View Post
try using the following at the command prompt

c:\>test.exe < 1

i think it should work

thanks
hi manu123

i think that will not work under windows

i tried the following and worked fine

Code:
c:\>echo 29-12-2008 | date
The current date is: 29/12/2008
Enter the new date: (dd-mm-yy) 29-12-2008
try using
Code:
c:\>echo 1 | test.exe
should work.

thanks
 
Old December 29th, 2008, 05:05 PM
Registered User
 
Join Date: Dec 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your answer.


I tryied your code, but it doesnt work, i think i did something wrong with the includes.

I tryied this

Code:
#include <iostream>
#include <iomanip>
using namespace std;

int main ()
{


C:\BACKUP>echo 1 | tr.exe

fflush (stdin);
getchar ();
return 0;
}
Then allways this 3errors come up:

http://img176.imageshack.us/img176/5941/needdyb7.jpg

Iam sure just did a little msitake but i just started coding, so please Help me, maybe write the whole code then i'll use it in the future :).

But thanks alot for your reply
best Regards :)

Last edited by manu123; December 29th, 2008 at 05:14 PM..
 
Old December 29th, 2008, 05:34 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

goto start>run> enter "cmd" press enter

in dos prompt type
Code:
cd \
cd BACKUP
echo 1 | tr.exe
check if it works

thanks
 
Old December 29th, 2008, 05:39 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Code:
#include <stdlib.h>
#include<stdio.h>

int main()
{
	(void)system("C:\\BACKUP\\echo 1 | tr.exe");
getch();
	return(0);
}
try this as well...
thanks
 
Old December 29th, 2008, 05:40 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

goto start>run> enter "cmd" press enter

in dos prompt type
Code:
cd \
cd BACKUP
echo 1 | tr.exe
check if it works

thanks
 
Old December 29th, 2008, 05:54 PM
Registered User
 
Join Date: Dec 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

... Dont know why it doesnt work

when i start i getting this error all the time in the msdos window

Der Befehl "C:\BACKUP\echo" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

in english:

The command "C:\BACKUP\echo" is written wrong or couldnt be founded.

What did i wrong :(

e// i can start the program with

start tr.exe but then it doesnt choose option 1
is it possible that echo1 wouldnt work ?

Last edited by manu123; December 29th, 2008 at 06:01 PM..
 
Old December 29th, 2008, 06:44 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by manu123 View Post

e// i can start the program with

start tr.exe but then it doesnt choose option 1
is it possible that echo1 wouldnt work ?

try

Code:
start echo 1 | tr.exe
thanks
 
Old December 29th, 2008, 06:47 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by manu123 View Post
... Dont know why it doesnt work

when i start i getting this error all the time in the msdos window

Der Befehl "C:\BACKUP\echo" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

in english:

The command "C:\BACKUP\echo" is written wrong or couldnt be founded.

What did i wrong :(

e// i can start the program with

start tr.exe but then it doesnt choose option 1
is it possible that echo1 wouldnt work ?
send me the tr.exe i will try to do it myself.

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
Membership: aspnet_sql.exe -> aspnet_regsql.exe ricpue BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 August 9th, 2006 11:40 PM
problem creating .exe from MFC AppWizard(exe) c++ method Visual C++ 0 July 7th, 2006 03:28 AM
How to start an EXE on remote machine Nalin General .NET 0 February 24th, 2005 05:39 AM
PHP5 and php.exe php-cgi.exe php-win.exe freddo Beginning PHP 1 August 16th, 2004 09:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.