Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Making a system command work via a scheduled task.

by DeryniMagic (Initiate)
on May 08, 2012 at 10:00 UTC ( [id://969402]=perlquestion: print w/replies, xml ) Need Help??

DeryniMagic has asked for the wisdom of the Perl Monks concerning the following question:

This snippet of code works well if I run it from the command line, but does not output anything if I invoke it via a scheduled task. Any pointers as to what I'm doing wrong would be appreciated.

use strict; use IO::File; my @groups = qx/net localgroup/; my $fhout = IO::File->new("g:\\iw-home\\scripts\\Test.txt", 'w'); foreach my $grp (@groups) { print $fhout $grp , "\n"; }

Replies are listed 'Best First'.
Re: Making a system command work via a scheduled task.
by Anonymous Monk on May 08, 2012 at 10:12 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://969402]
Approved by lidden
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found