473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Running a service from the cmd prompt.

UJ
I thought I saw somewhere that you could run a service from the cmd prompt
and then any Console.Write you did would go to the screen.

Is that true?

TIA - Jeff.
Feb 17 '06 #1
6 1529
It is in unmanaged C/C++, but I don't think you can do it using .net.

Feb 17 '06 #2
Hi,

Hi,

You can use NET START "service name" to strt the service, not sure (don't
think so) that you can see the output to the console.
note that the service should be installed.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"UJ" <fr**@nowhere.com> wrote in message
news:e3*************@TK2MSFTNGP15.phx.gbl...
I thought I saw somewhere that you could run a service from the cmd prompt
and then any Console.Write you did would go to the screen.

Is that true?

TIA - Jeff.

Feb 22 '06 #3
"net start" is used to start a service, what the OP is looking for is to
start a 'service' as a Console program which is not possible unless you
modify the service such that it can run as both, for instance by passing a
command line argument that tells the process to run as a Console program.
Willy.

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:ev**************@TK2MSFTNGP11.phx.gbl...
| Hi,
|
| Hi,
|
| You can use NET START "service name" to strt the service, not sure
(don't
| think so) that you can see the output to the console.
| note that the service should be installed.
|
|
| --
| Ignacio Machin,
| ignacio.machin AT dot.state.fl.us
| Florida Department Of Transportation
|
| "UJ" <fr**@nowhere.com> wrote in message
| news:e3*************@TK2MSFTNGP15.phx.gbl...
| >I thought I saw somewhere that you could run a service from the cmd
prompt
| >and then any Console.Write you did would go to the screen.
| >
| > Is that true?
| >
| > TIA - Jeff.
| >
| >
|
|
Feb 22 '06 #4
Can that be done anymore, I haven't worked too much with services in
..net, but the ones I have worked on seemed to have had allot done to
them by the ide to prevent this?

Feb 23 '06 #5

"william_dudek@_yahoo_com" <wi***********@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
| Can that be done anymore, I haven't worked too much with services in
| .net, but the ones I have worked on seemed to have had allot done to
| them by the ide to prevent this?
|

Sure it can be done, but you need to change your code such that it follows a
different path when you start it from the command prompt. Remember that
Services are started by the SCM, which establishes a named pipe connection
through witch it communicates with the service, this named pipe channels is
used by the SCM to send commands like Start, Stop, Pause etc... to the
service, the Service itself uses the same pipe to report the status or
status changes back to the SCM. So this whole thing has to be skipped when
launching from the command line, not a trivial thing to do but not
impossible too.

Willy.

Feb 23 '06 #6
Thanks, that's how I rememeber them working before .net, I thought it
was odd that they couldn't work that way any more. Do you (or anyone)
know of any books or websites on the subject, I have been working with
services for years, but don't know the details of how they work behind
the scenes.

Feb 23 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bill Hauver | last post by:
I am attempting to use a web service from my work pc which is behind a firewall. I have used wsdl.exe to create the web service reference class and added it to my project. (this seems to work...
8
by: Russ Green | last post by:
I'm using a Setup Project in VB.NET 2003 Standard to install a windows service application. I would like this installer to start the service after install. How do I do that? Thanks, Russ
15
by: Sims | last post by:
Hi, I have a service that need to access the current user registry from time to time. But a service only works as a SYSTEM and not as the current user. How can i change that? Or at the very...
5
by: Dafna | last post by:
while trying to open an Asp .Net application ' I get the following message (the IIS on my computer is running) "Visual Studio .Net has detected that the specified web server is not running ASP...
7
by: scarred wind | last post by:
when i run my program, an error message prompt me that i should add the installutil.exe. How do i checked for the installutil.exe? How can i add it to my Timer program? ...
5
by: SiD` | last post by:
when starting a windows service writte in vb.net, a messagebox appears: cannot start service from the command line or a debugger. A windows service must first be installed using installutil.exe ...
1
by: NathanC | last post by:
I am trying to create a simple service since and have never done this before. I have created a new project in VB.NET that is a Windows Service. (Just writing a single event entry to the log, just...
13
by: dancer | last post by:
I have made a new post because when I try to respond to another, I get the error, "Article Rejected -- Ill-formed message id" This is in response to the advice of Juan Libre to install Net...
0
terryble
by: terryble | last post by:
hy, We are deploying IPPhone cisco(R) On this phone proprietary code exist with XML too. After code modification, a can't find the final step for this service to work. I need to post the variable...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.