Solved

0x41301 scheduled task error

Posted on 2014-03-05
3
1,475 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 37

Accepted Solution

by:
Gerwin Jansen 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Several part series to implement Internet Explorer 11 Enterprise Mode
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now