I haven't used this, but it allows you to install your script to run as a service, you should be able to modify the service definition to change the user to a logged in user.
(BTW, If it need to interact with the desktop, you'll need to ensure you are on console:0 to see it. In general, only a physical login gets you to console:0. A remote desktop login doesn't get you there.) \\Greg -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ted Zeng Sent: Tuesday, November 15, 2005 4:09 PM To: Steven Manross; [email protected] Subject: Re: How to let a perl script quit when Windows shut down? I tried that. The problem is Service is Local System user. It behaves differently from a normal log in user. Sometimes, it could not launch an application even the Option "Interact with desktop" is checked. Ted zeng On 11/15/05 12:46 PM, "Steven Manross" <[EMAIL PROTECTED]> wrote: > Start using Win32::Daemon to have what looks like a service (your > script) act like a service and shut down gracefully when asked to do so. > > http://www.roth.net/perl/Daemon/ > > Steven > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Ted Zeng > Sent: Monday, November 14, 2005 8:25 PM > To: [email protected] > Subject: How to let a perl script quit when Windows shut down? > > Hi, > > I have a perl script that runs an infinite loop. > It looks like this > While(1){ > Sleep(3); > {do something} > } > > My problem is: when I shut down Windows XP, The script doesn't stop. > Windows put a dialog asking If I want to stop the script. > > What could I do in the script to let it stop Automatically? > > Ted zeng > > > > _______________________________________________ > Perl-Win32-Users mailing list > [email protected] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > _______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
