Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Win32::Taskscheduler failed to install on win7

by BrowserUk (Patriarch)
on Jul 27, 2011 at 08:31 UTC ( [id://916962]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Win32::Taskscheduler failed to install on win7
in thread Win32::Taskscheduler failed to install on win7

can only schedule ... batch files ... not Perl files

So wrap the perl file in a batch file. Is it too complicated? How about two lines (and one's a comment! :)

rem yourapp.bat \path\to\your\perl.exe \path\to\yourapp.pl %*

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: Win32::Taskscheduler failed to install on win7
by mkhan (Sexton) on Jul 27, 2011 at 09:44 UTC
    Wow, some good suggestions there.

    Pardon my ignorance as I'm relatively new to this stuff.
    I notice that when the scheduler kickstarts my .pl file, It immediately ends with "End of Program".

    Surprisingly, even if I do this:
    C:\>perl C:\Perl64\bin\tap.pl End of program
    i.e. try to run by giving the absolute path from C:\ on my cmd prompt, it shows the same thing "End of Program".

    If I go to the directory containing tap.pl, however, i.e. (C:\Perl64\bin) and THEN run just tap.pl, it runs properly.

    Could someone clarify what's going on?
    Why does the script not run when I enter the Entire path? It doesn't run even if I do a "perl C:\Perl64\bin\tap.pl"

      Most likely, your program ("tap.pl") depends on getting launched with the current directory being C:\Perl64\bin. You could try to debug this by launching it with the full path from the directory:

      cd C:\Perl64\bin perl -w C:\Perl64\bin\tap.pl

      If the program expects to be launched from that directory, either change it or launch it from that direcctory.

        After some trial and error, it turns out guys were right.
        There is no strict need of a .bat or .exe file.
        The problem was as mentioned in my last post. Windows couldn't run them from any other directory than C:\Perl64\bin .

        What I did was a simple workaround. I first make my scheduler to change directory to C:\Perl64\bin and in the same command I run tap.pl. Oh and I'm using "at" command btw.
        $status = `at 3:09 cmd /c cd C:\\Perl64\\bin&tap.pl`;
        It works. Further discussion/suggestions are welcome.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-26 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found