in reply to using TaskScheduler to reboot Win32 machine
The docs (Win32::TaskScheduler) say SetApplicationName expects just the name of the app. Use SetParameters for the rest, ie:
my $APP_NAME = q#c:\\perl\\bin\\perl.exe#; my $PARAMS = q#-MWin32 -e "Win32::InitiateSystemShutdown(' ','Rebootin +g',5,1,1);"#; # ... $scheduler->SetApplicationName( $APP_NAME ); $scheduler->SetParameters( $PARAMS );
Note: untested!!! now tested, parameters and command line are properly quoted.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: using TaskScheduler to reboot Win32 machine
by ethrbunny (Monk) on Jul 12, 2007 at 03:41 UTC | |
by Rabbi Bob (Scribe) on Jul 12, 2007 at 11:10 UTC | |
by magikstik! (Initiate) on Jul 12, 2007 at 11:18 UTC | |
by ethrbunny (Monk) on Jul 12, 2007 at 12:50 UTC | |
by Rabbi Bob (Scribe) on Jul 12, 2007 at 16:40 UTC |
In Section
Seekers of Perl Wisdom