Solved

0x41301 scheduled task error

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

803 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