Server 2008 R2 Task Scheduler permissionf for a vbs script
The answer is as follows:
When setting up the Action, rather than set the 'Program/script' to include the path (e.g. "C:\Scripts\Backup.vbs"), you need to set the 'Program/script' as "Backup.vbs" and the 'Start in' as "C:\Scripts\"
The script now works!
Thanks to http://www.blogfodder.co.uk/2012/4/20/win-2008-task-scheduler-with-return-code-1-0x1 for the suggestion...
Related videos on Youtube
Mjukilop
Updated on September 18, 2022Comments
-
Mjukilop over 1 year
I have a situation where I create multiple arrays from conditions imposed on data which I need to compare.
For instance consider this set of data (in cells):
A1: ASD A2: ASF A3: A4: NOTTHISONE
I then impose two conditions:
NOT(ISBLANK(A1:A4) and; LEN(A1:A4)<4
which return the following respective arrays
{TRUE,TRUE,FALSE,TRUE} and; {TRUE,TRUE,TRUE,FALSE}
I then wish to make an AND comparison on the VALUES of these arrays (not comparing the full arrays). This should yield:
{TRUE,TRUE,FALSE,FALSE}
But using AND() or '=' appears to compare the two arrays as full objects and hence returns false (as {TRUE,TRUE,FALSE,TRUE}!={TRUE,TRUE,TRUE,FALSE}).
Is there a way to achieve the comparison I am looking for?
-
kafka over 11 yearssetting 'Run whether used logged on or not' and 'Run with highest privileges' should be all you require for the task to run. If the issue does lie with FSO Delete folder then why does it run manually but not as a scheduled task? If the command is the issue, and there's no workaround, would there be any benefit to re-writing the script in Powershell?
-
JezB over 11 years'Run whether used logged on or not' and 'Run with highest privileges' are already set... as you say, might need to re-think...
-
kafka over 11 yearswhere does the folder live, ie is it local, or a UNC share / mapped network drive?
-
JezB over 11 yearsIt's local - C:\MySQL_Backups\20130112\ etc.
-
BruceWayne over 6 yearsSo as an output, what are you trying to get?
True, True, False, False
? As you noted,=AND(NOT(ISBLANK(A1:A4)),LEN(A1:A4)<4)
will evaluate to justFalse
.
-
-
JezB over 11 yearsIt's definitely a permissions issue - if I set the folder to allow Everyone full control, it works...
-
JezB over 11 yearsCorrection - I can delete files, but not the folders...
-
Ansgar Wiechers over 11 yearsCheck the permissions of the parent folder (there's a script on my homepage that might be helpful). Also check the actual error message (see 2nd code sample in my answer).
-
Mjukilop over 6 yearsPerfect, this is just what I need. Thank you.