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

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"

Replies are listed 'Best First'.
Re^5: Win32::Taskscheduler failed to install on win7
by Corion (Patriarch) on Jul 27, 2011 at 09:46 UTC

    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.