Solved

0x41301 scheduled task error

Posted on 2014-03-05
3
1,605 Views
Last Modified: 2014-11-18
I have a vbs script that backups some directories to a usb or nas attached device.
The script works fine when launched manually and it works when doing a backup to an usb hard drive.
When it is scheduled, it gives the error 0x41301 but nothing happens.

SCHED_S_TASK_RUNNING
0x00041301
The task is currently running.

I found somewhere to troubleshoot what really happens :
@echo off
echo %date% %time% %username% >> c:\bat\test.txt
cscript //nologo c:\bat\backup2landisk.vbs 1>>c:\bat\test.txt 2>>&1
echo %date% %time% >> c:\bat\test.txt

test.txt :
Tue 03/04/2014 23:30:00.43 Administrator
Z:\Backups
c:\bat\backup2landisk.vbs(186, 19) Microsoft VBScript runtime error: Path not found

So the problem is related to the problem of Windows addressing networkdrives through a script.

I already disabled UAC, ran with highest privileges, defined workpath,
EnabledLinkedConnections parameter set to 1.

Any help would be appreciated.
Thanks.
0
Comment
Question by:McRight
3 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 500 total points
ID: 39908058
The task manager is running as 'SYSTEM' and 'SYSTEM' has no drive mappings, like your Z: for example that is probably mapped to your NAS device. You can try using \\nas\share (if that's what Z: is mapped to) instead, this share would have to be available to everyone for writing.

Is is not a Windows problem, just a security related issue because your SYSTEM 'user' has no access to the shared location you're specifying.

You could also add a line in your script that maps the Z: drive before trying to access it, like this:

net use z: \\nas\share /user:username password

But this would mean that username and password are readable in the script, you have to decide if this is a problem or not.
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question