Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

0x41301 scheduled task error

Posted on 2014-03-05
3
Medium Priority
?
1,866 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
1 Comment
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

824 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