Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 940505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:58:08+00:00 2026-05-15T21:58:08+00:00

I have written a tool that is run on the command line. I can

  • 0

I have written a tool that is run on the command line.
I can test it on the command line on my machine, and it works fine.
I then remote into the target server machine and run it on the command line there, and it still works.

However…this tool needs to remain running (its a monitoring tool).
I can’t leave my remote session to that machine open for too long, as other people need to use it, and when I close my remote session, that command line tool ends.

I don’t know how to, and would like to avoid needing to, write a windows service, but essentially I need that capability. I need to almost wrap my command line tool with a windows service that can remain running on the target machine while I disconnect.

Can anyone provide any insight/strategy on how to do this?

Edit:
Both of the below posts are helpful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:58:09+00:00Added an answer on May 15, 2026 at 9:58 pm

    If it’s Windows Server 2003 or earlier you can use Srvany.exe to run any application as a service. See here for details.

    If it’s Windows Server 2008, SrvAny isn’t supported officially, but you might be able to hack it to work by copying it from Win2003 Resource Kit or earlier and then combining it with the instructions in Thomas answer in some way.

    However, writing a proper Windows Service is really quite simple and it’s the best way to make sure that it’ll coexist happily with everything else.

    Just create a Windows Service project in Visual Studio. In the OnStart you create a thread that runs your code. In the OnStop you use a flag to stop the service. Then you can make it better later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written a command line tool that preprocesses a number of files then compiles
I have a couple processes running a tool I've written that are joined by
I have written a tool that references Microsoft.TeamFoundation.VersionControl.Client.dll, which is a 32-bit DLL. When
I have inherited a 20-year-old interactive command-line unix application that is no longer supported
I have a java application I've written in eclipse. It works fine there. It
I have written a tool for mgmt that updates Completed field of TFS WorkItem
I have written a small tool for our customers that downloads the latest stable
I have an XML document collection, an inverted file indexer, and a command-line tool
I have written a tool tip snippet, its throwing error like TOO MUCH RECURSION
I have written a tool to collect log files within a time window specified

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.