Solved

0x41301 scheduled task error

Posted on 2014-03-05
3
1,651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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