Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

(tye)Re: Running Perl code from a Windows service

by tye (Sage)
on Sep 19, 2001 at 01:44 UTC ( #113226=note: print w/replies, xml ) Need Help??

in reply to Running Perl code from a Windows service

Services run in interesting security contexts. In WinNT, from the Services control panel you can click "Startup" and request that the server be given access to the desktop (unless you've configured a non-default security context for that service already). This might be the problem that you are having. I'll try to check later if this is the same on Win2K.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: Running Perl code from a Windows service

Replies are listed 'Best First'.
Re: (tye)Re: Running Perl code from a Windows service
by HamNRye (Monk) on Sep 19, 2001 at 02:46 UTC

    A few things: Services can interact with the command line or the network, not both. Services will fail if they must do both.

    Use the srvany.exe to run your perl script as a service.


      Services can interact with the command line or the network
      I think you mean desktop as opposed to command line.

      By default, the service will probably run as LocalSystem - which has the option of accessing the desktop, but can't access the network. If you run it as a domain\workgroup user, it will be able to access the network and it will be able to spawn processes, but they won't be visible to the interactive user.

      Finally, I prefer Win32::Daemon to srvany.exe - It's a bit more work, but so much more powerful.

      update: No. I don't have shares in Dave Roth!

      Simon Flack ($code or die)
      $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
      =~y'_"' ';eval"die";print $_,lc substr$@,0,3;
        A service should not need to access the desktop. It can, BTW, throw up a message box for an error and it will be visible to any desktop that's current. There's a special flag in MessageBox for this.

        But the service will normally work behind the scenes. Another program, running as a normal program in the current interactive user's account, can interact with the user and communicate with the service. That's the model MS describes.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://113226]
[stevieb]: Torturing one of my dev RPis to turn four 5v stepper motors at the same time (via Parallel:: ForkManager for 50k degrees (a whole lot of full turns!). Let's see if it burns out or not.

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-03-22 22:10 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (286 votes). Check out past polls.