The following works for me on XP:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SrvAny\Parameter +s] "Application"="\\perl\\bin\\wperl.exe \\test\\service.pl"
Modify the paths to your wperl and script accordingly.
#! perl -slw use strict; use Win32; open LOG, '>', 'c:\test\service.log' or die; select LOG; $|++; Win32::MsgBox( 'From service.pl at ' . localtime, 0, "Service.pl" ); while( sleep 5 ) { Win32::MsgBox( 'From service.pl at ' . localtime, 0, "Service.pl" + ); print scalar localtime; } close LOG;
It pops up a message box on startup and every 5 seconds thereafter. (And bloody annoying it is too :)
It creates and writes to the log file.
YMMV on Vista.
In reply to Re^6: Turn a perl script into a Win32 Service
by BrowserUk
in thread Turn a perl script into a Win32 Service
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |