Loading ...
Sorry, an error occurred while loading the content.

batchfile as service

Expand Messages
  • Raja Sekhar
    Hi, I wanted to run a batchfile as service and added it using instsrv.exe but am getting error The service is not responding to the control function. More help
    Message 1 of 5 , Aug 1, 2007
    • 0 Attachment
      Hi,
      I wanted to run a batchfile as service and added it using instsrv.exe but am getting error

      The service is not responding to the control function.

      More help is available by typing NET HELPMSG 2186.


      for example if the batchfile is something like this and i run this from cmd prompt it runs fine and if i add it to the services i get error, any workaround for this as i have a program which runs in foreground and want it to be run from services.when checked Programs like apache.exe runs fine when used in this proceedure

      @echo off
      echo ping localhost -t > work.bat
      start /min work.bat

      Thanks,
      Raja Sekhar


      ---------------------------------
      Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.

      [Non-text portions of this message have been removed]
    • foxidrive
      On Wed, 1 Aug 2007 21:36:43 -0700 (PDT), Raja Sekhar ... This page says it does not work for batch files.
      Message 2 of 5 , Aug 1, 2007
      • 0 Attachment
        On Wed, 1 Aug 2007 21:36:43 -0700 (PDT), Raja Sekhar <rajasn@...>
        wrote:


        >I wanted to run a batchfile as service and added it using instsrv.exe but am getting error

        This page says it does not work for batch files.

        http://support.microsoft.com/kb/137890

        "SUMMARY
        The Windows NT Resource Kit provides two utilities that allow you to create
        a Windows NT user-defined service for Windows NT applications and some
        16-bit applications (but not for batch files)."
      • Raja Sekhar
        If we add the below mentioned batfile it is running fine.We can install this bat file as service and then start the service , no error @echo off
        Message 3 of 5 , Aug 2, 2007
        • 0 Attachment
          If we add the below mentioned batfile it is running fine.We can install this bat file as service and then start the service , no error

          @echo off
          c:\apache\bin\apache.exe "-k -runservice"

          ----- Original Message -----
          From: foxidrive
          To: batchworld@yahoogroups.com
          Sent: Thursday, August 02, 2007 12:09 PM
          Subject: Re: [BATCH WORLD] batchfile as service



          On Wed, 1 Aug 2007 21:36:43 -0700 (PDT), Raja Sekhar <rajasn@...>
          wrote:

          >I wanted to run a batchfile as service and added it using instsrv.exe but am getting error

          This page says it does not work for batch files.

          http://support.microsoft.com/kb/137890

          "SUMMARY
          The Windows NT Resource Kit provides two utilities that allow you to create
          a Windows NT user-defined service for Windows NT applications and some
          16-bit applications (but not for batch files)."



          #ygrp-mlmsg { FONT-SIZE: small; FONT-FAMILY: arial,helvetica,clean,sans-serif}#ygrp-mlmsg TABLE { }#ygrp-mlmsg SELECT { FONT: 99% arial,helvetica,clean,sans-serif}INPUT { FONT: 99% arial,helvetica,clean,sans-serif}TEXTAREA { FONT: 99% arial,helvetica,clean,sans-serif}#ygrp-mlmsg PRE { FONT: 100% monospace}CODE { FONT: 100% monospace}#ygrp-mlmsg * { LINE-HEIGHT: 1.22em}#ygrp-text { FONT-FAMILY: Georgia}#ygrp-text P { MARGIN: 0px 0px 1em}#ygrp-tpmsgs { CLEAR: both; FONT-FAMILY: Arial}#ygrp-vitnav { FONT-SIZE: 77%; MARGIN: 0px; PADDING-TOP: 10px; FONT-FAMILY: Verdana}#ygrp-vitnav A { PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}#ygrp-actbar { CLEAR: both; MARGIN: 25px 0px; COLOR: #666; WHITE-SPACE: nowrap; TEXT-ALIGN: right}#ygrp-actbar .left { FLOAT: left; WHITE-SPACE: nowrap}..bld { FONT-WEIGHT: bold}#ygrp-grft { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 77%; PADDING-BOTTOM: 15px; PADDING-TOP: 15px; FONT-FAMILY:
          Verdana}#ygrp-ft { PADDING-RIGHT: 0px; BORDER-TOP: #666 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 77%; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; FONT-FAMILY: verdana}#ygrp-mlmsg #logo { PADDING-BOTTOM: 10px}#ygrp-vital { PADDING-RIGHT: 0px; PADDING-LEFT: 8px; MARGIN-BOTTOM: 20px; PADDING-BOTTOM: 8px; PADDING-TOP: 2px; BACKGROUND-COLOR: #e0ecee}#ygrp-vital #vithd { FONT-WEIGHT: bold; FONT-SIZE: 77%; TEXT-TRANSFORM: uppercase; COLOR: #333; FONT-FAMILY: Verdana}#ygrp-vital UL { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 2px 0px; PADDING-TOP: 0px}#ygrp-vital UL LI { CLEAR: both; BORDER-RIGHT: #e0ecee 1px solid; BORDER-TOP: #e0ecee 1px solid; BORDER-LEFT: #e0ecee 1px solid; BORDER-BOTTOM: #e0ecee 1px solid; LIST-STYLE-TYPE: none}#ygrp-vital UL LI .ct { PADDING-RIGHT: 0.5em; FONT-WEIGHT: bold; FLOAT: right; WIDTH: 2em; COLOR: #ff7900; TEXT-ALIGN: right}#ygrp-vital UL LI .cat { FONT-WEIGHT: bold}#ygrp-vital A { TEXT-DECORATION: none}#ygrp-vital A:hover {
          TEXT-DECORATION: underline}#ygrp-sponsor #hd { FONT-SIZE: 77%; COLOR: #999}#ygrp-sponsor #ov { PADDING-RIGHT: 13px; PADDING-LEFT: 13px; MARGIN-BOTTOM: 20px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px; BACKGROUND-COLOR: #e0ecee}#ygrp-sponsor #ov UL { PADDING-RIGHT: 0px; PADDING-LEFT: 8px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px}#ygrp-sponsor #ov LI { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 77%; PADDING-BOTTOM: 6px; PADDING-TOP: 6px; LIST-STYLE-TYPE: square}#ygrp-sponsor #ov LI A { FONT-SIZE: 130%; TEXT-DECORATION: none}#ygrp-sponsor #nc { PADDING-RIGHT: 8px; PADDING-LEFT: 8px; MARGIN-BOTTOM: 20px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BACKGROUND-COLOR: #eee}#ygrp-sponsor .ad { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px}#ygrp-sponsor .ad #hd1 { FONT-WEIGHT: bold; FONT-SIZE: 100%; COLOR: #628c2a; LINE-HEIGHT: 122%; FONT-FAMILY: Arial}#ygrp-sponsor .ad A { TEXT-DECORATION: none}#ygrp-sponsor .ad A:hover { TEXT-DECORATION:
          underline}#ygrp-sponsor .ad P { MARGIN: 0px}o { FONT-SIZE: 0px}..MsoNormal { MARGIN: 0px}#ygrp-text TT { FONT-SIZE: 120%}BLOCKQUOTE { MARGIN: 0px 0px 0px 4px}..replbq { }

          ---------------------------------
          Need a vacation? Get great deals to amazing places on Yahoo! Travel.

          [Non-text portions of this message have been removed]
        • foxidrive
          As I see it that batch file adds apache as a service itself. It doesn t need instsrv.exe to do it. What are you trying to achieve? Your example bat file
          Message 4 of 5 , Aug 2, 2007
          • 0 Attachment
            As I see it that batch file adds apache as a service itself. It doesn't
            need instsrv.exe to do it.

            What are you trying to achieve? Your example bat file redirected the ping
            output to a temp bat file and then launched the batch file. What did you
            expect that to do?

            >>> @echo off
            >>> echo ping localhost -t > work.bat
            >>> start /min work.bat


            On Thu, 2 Aug 2007 04:51:52 -0700 (PDT), Raja Sekhar <rajasn@...>
            wrote:

            >If we add the below mentioned batfile it is running fine.We can install this bat file as service and then start the service , no error
            >
            >@echo off
            >c:\apache\bin\apache.exe "-k -runservice"
            >
            > ----- Original Message -----
            > From: foxidrive
            > To: batchworld@yahoogroups.com
            > Sent: Thursday, August 02, 2007 12:09 PM
            > Subject: Re: [BATCH WORLD] batchfile as service
            >
            >
            >
            >On Wed, 1 Aug 2007 21:36:43 -0700 (PDT), Raja Sekhar <rajasn@...>
            >wrote:
            >
            >>I wanted to run a batchfile as service and added it using instsrv.exe but am getting error
            >
            >This page says it does not work for batch files.
            >
            >http://support.microsoft.com/kb/137890
            >
            >"SUMMARY
            >The Windows NT Resource Kit provides two utilities that allow you to create
            >a Windows NT user-defined service for Windows NT applications and some
            >16-bit applications (but not for batch files)."
            >
          • Raja Sekhar
            yes but i am adding the batchfile for apache as service using instsrv.exe and it runs fine. the ping one was just for testing , actually i have eventlog.exe
            Message 5 of 5 , Aug 2, 2007
            • 0 Attachment
              yes but i am adding the batchfile for apache as service using instsrv.exe and it runs fine.
              the ping one was just for testing , actually i have eventlog.exe -b -rt 120 -f serverx.txt and i want this to be run as service than running it manually.
              when i use the same syntax n batchfile and its runs with out problem.But as a service it doesnot run and that is why i used start /min option as the eventlog.exe runs in forground and a cmd prompt is open

              Raja Sekhar

              ----- Original Message -----
              From: foxidrive
              To: batchworld@yahoogroups.com
              Sent: Thursday, August 02, 2007 6:18 PM
              Subject: Re: [BATCH WORLD] batchfile as service




              As I see it that batch file adds apache as a service itself. It doesn't
              need instsrv.exe to do it.

              What are you trying to achieve? Your example bat file redirected the ping
              output to a temp bat file and then launched the batch file. What did you
              expect that to do?

              >>> @echo off
              >>> echo ping localhost -t > work.bat
              >>> start /min work.bat

              On Thu, 2 Aug 2007 04:51:52 -0700 (PDT), Raja Sekhar <rajasn@...>
              wrote:

              >If we add the below mentioned batfile it is running fine.We can install this bat file as service and then start the service , no error
              >
              >@echo off
              >c:\apache\bin\apache.exe "-k -runservice"
              >
              > ----- Original Message -----
              > From: foxidrive
              > To: batchworld@yahoogroups.com
              > Sent: Thursday, August 02, 2007 12:09 PM
              > Subject: Re: [BATCH WORLD] batchfile as service
              >
              >
              >
              >On Wed, 1 Aug 2007 21:36:43 -0700 (PDT), Raja Sekhar <rajasn@...>
              >wrote:
              >
              >>I wanted to run a batchfile as service and added it using instsrv.exe but am getting error
              >
              >This page says it does not work for batch files.
              >
              >http://support.microsoft.com/kb/137890
              >
              >"SUMMARY
              >The Windows NT Resource Kit provides two utilities that allow you to create
              >a Windows NT user-defined service for Windows NT applications and some
              >16-bit applications (but not for batch files)."
              >



              #ygrp-mlmsg { FONT-SIZE: small; FONT-FAMILY: arial,helvetica,clean,sans-serif}#ygrp-mlmsg TABLE { }#ygrp-mlmsg SELECT { FONT: 99% arial,helvetica,clean,sans-serif}INPUT { FONT: 99% arial,helvetica,clean,sans-serif}TEXTAREA { FONT: 99% arial,helvetica,clean,sans-serif}#ygrp-mlmsg PRE { FONT: 100% monospace}CODE { FONT: 100% monospace}#ygrp-mlmsg * { LINE-HEIGHT: 1.22em}#ygrp-text { FONT-FAMILY: Georgia}#ygrp-text P { MARGIN: 0px 0px 1em}#ygrp-tpmsgs { CLEAR: both; FONT-FAMILY: Arial}#ygrp-vitnav { FONT-SIZE: 77%; MARGIN: 0px; PADDING-TOP: 10px; FONT-FAMILY: Verdana}#ygrp-vitnav A { PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}#ygrp-actbar { CLEAR: both; MARGIN: 25px 0px; COLOR: #666; WHITE-SPACE: nowrap; TEXT-ALIGN: right}#ygrp-actbar .left { FLOAT: left; WHITE-SPACE: nowrap}..bld { FONT-WEIGHT: bold}#ygrp-grft { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 77%; PADDING-BOTTOM: 15px; PADDING-TOP: 15px; FONT-FAMILY:
              Verdana}#ygrp-ft { PADDING-RIGHT: 0px; BORDER-TOP: #666 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 77%; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; FONT-FAMILY: verdana}#ygrp-mlmsg #logo { PADDING-BOTTOM: 10px}#ygrp-vital { PADDING-RIGHT: 0px; PADDING-LEFT: 8px; MARGIN-BOTTOM: 20px; PADDING-BOTTOM: 8px; PADDING-TOP: 2px; BACKGROUND-COLOR: #e0ecee}#ygrp-vital #vithd { FONT-WEIGHT: bold; FONT-SIZE: 77%; TEXT-TRANSFORM: uppercase; COLOR: #333; FONT-FAMILY: Verdana}#ygrp-vital UL { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 2px 0px; PADDING-TOP: 0px}#ygrp-vital UL LI { CLEAR: both; BORDER-RIGHT: #e0ecee 1px solid; BORDER-TOP: #e0ecee 1px solid; BORDER-LEFT: #e0ecee 1px solid; BORDER-BOTTOM: #e0ecee 1px solid; LIST-STYLE-TYPE: none}#ygrp-vital UL LI .ct { PADDING-RIGHT: 0.5em; FONT-WEIGHT: bold; FLOAT: right; WIDTH: 2em; COLOR: #ff7900; TEXT-ALIGN: right}#ygrp-vital UL LI .cat { FONT-WEIGHT: bold}#ygrp-vital A { TEXT-DECORATION: none}#ygrp-vital A:hover {
              TEXT-DECORATION: underline}#ygrp-sponsor #hd { FONT-SIZE: 77%; COLOR: #999}#ygrp-sponsor #ov { PADDING-RIGHT: 13px; PADDING-LEFT: 13px; MARGIN-BOTTOM: 20px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px; BACKGROUND-COLOR: #e0ecee}#ygrp-sponsor #ov UL { PADDING-RIGHT: 0px; PADDING-LEFT: 8px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px}#ygrp-sponsor #ov LI { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 77%; PADDING-BOTTOM: 6px; PADDING-TOP: 6px; LIST-STYLE-TYPE: square}#ygrp-sponsor #ov LI A { FONT-SIZE: 130%; TEXT-DECORATION: none}#ygrp-sponsor #nc { PADDING-RIGHT: 8px; PADDING-LEFT: 8px; MARGIN-BOTTOM: 20px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BACKGROUND-COLOR: #eee}#ygrp-sponsor .ad { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px}#ygrp-sponsor .ad #hd1 { FONT-WEIGHT: bold; FONT-SIZE: 100%; COLOR: #628c2a; LINE-HEIGHT: 122%; FONT-FAMILY: Arial}#ygrp-sponsor .ad A { TEXT-DECORATION: none}#ygrp-sponsor .ad A:hover { TEXT-DECORATION:
              underline}#ygrp-sponsor .ad P { MARGIN: 0px}o { FONT-SIZE: 0px}..MsoNormal { MARGIN: 0px}#ygrp-text TT { FONT-SIZE: 120%}BLOCKQUOTE { MARGIN: 0px 0px 0px 4px}..replbq { }

              ---------------------------------
              Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.

              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.