+ Post New Thread
Results 1 to 9 of 9
Windows Server 2000/2003 Thread, Scheduled Task issues 0x2 error in Technical; Hi, I'm trying to get a scheduled task to run a perl script that performs our backup. When i run ...
  1. #1
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    259
    Thank Post
    44
    Thanked 58 Times in 39 Posts
    Rep Power
    23

    Scheduled Task issues 0x2 error

    Hi,
    I'm trying to get a scheduled task to run a perl script that performs our backup.

    When i run the script manually (double click) it works fine, and backs everything up properly.

    When i schedule it however, it doesn't work and exits with error code 0x2. I've looked on google and this seems to indicate "file not found". I've tried changing permissions, folders and user accounts but it still does this.

    My current theory is that it is failing on these use lines at the top:
    Code:
    use File::Path;
    use File::Copy;
    but why it works fine when run outside of the scheduled task i don't know!
    Can anyone shed any light on why this might be failing?!

  2. #2
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    259
    Thank Post
    44
    Thanked 58 Times in 39 Posts
    Rep Power
    23
    anyone?
    I'm out of ideas now.....

  3. #3
    Mcshammer_dj's Avatar
    Join Date
    Feb 2007
    Location
    Portsmouth
    Posts
    991
    Thank Post
    38
    Thanked 180 Times in 145 Posts
    Rep Power
    97
    check the password on the schedule.

  4. #4
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    259
    Thank Post
    44
    Thanked 58 Times in 39 Posts
    Rep Power
    23
    hi,
    i've tried several different users, and put the password in very carefully to check it but still no joy

  5. #5
    Mcshammer_dj's Avatar
    Join Date
    Feb 2007
    Location
    Portsmouth
    Posts
    991
    Thank Post
    38
    Thanked 180 Times in 145 Posts
    Rep Power
    97
    check permissions on the tasks and on the files, have you used the same user for each

  6. #6
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    259
    Thank Post
    44
    Thanked 58 Times in 39 Posts
    Rep Power
    23
    yeah i've checked that. All 3 accounts i used were domain admin accounts, and have full permisisons over the tasks, the backup script folder (and files) and the files to be backed up. Running the script manually (not through scheduled tasks) works fine though

  7. #7
    soapyfish's Avatar
    Join Date
    Dec 2008
    Location
    Hertfordshire
    Posts
    180
    Thank Post
    51
    Thanked 7 Times in 5 Posts
    Blog Entries
    1
    Rep Power
    14
    I am getting the exact same problem with a very basic script that maps a drive copies some file and then removes the drive mapping. Again it works fine if I run it by hand and fails if I schedule it.

    It started failing on Friday 18th September for no reason at all ??

  8. #8
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    259
    Thank Post
    44
    Thanked 58 Times in 39 Posts
    Rep Power
    23
    I'm not quite sure why this happens but it started working when there were no other users logged into the server. Make sure that everyone is logged off the server (remotely or locally) and see if it works then.

  9. #9
    mwnci's Avatar
    Join Date
    Oct 2006
    Location
    Cornwall
    Posts
    97
    Thank Post
    5
    Thanked 24 Times in 17 Posts
    Rep Power
    21
    I'm aware of an issue on server 2008 whereby if the script has quotation marks in it, it won't run, even if the script works perfectly when run manually. There is more info on it here:

    A scheduled task does not run as expected if a command-line argument is enclosed in quotation marks on a computer that is running Windows Server 2008 or Windows Vista SP1



SHARE:
+ Post New Thread

Similar Threads

  1. Script to create a scheduled task
    By FN-GM in forum Scripts
    Replies: 3
    Last Post: 2nd May 2009, 08:17 PM
  2. Exmerge Scheduled Task crashing
    By adamf in forum Windows
    Replies: 3
    Last Post: 1st December 2008, 12:00 PM
  3. Scheduled Task Error code 0x35
    By Stuart_C in forum Windows
    Replies: 0
    Last Post: 25th November 2008, 11:27 AM
  4. Scheduled task not displaying on desktop
    By Jobos in forum Windows
    Replies: 2
    Last Post: 30th April 2008, 04:16 PM
  5. Deploy a scheduled task!
    By Ste_Harve in forum How do you do....it?
    Replies: 2
    Last Post: 14th September 2007, 03:04 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •