Server 2008 R2 Task Scheduler permissionf for a vbs script

20

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...

Share:
20

Related videos on Youtube

Mjukilop
Author by

Mjukilop

Updated on September 18, 2022

Comments

  • Mjukilop
    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
      kafka over 11 years
      setting '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
      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
      kafka over 11 years
      where does the folder live, ie is it local, or a UNC share / mapped network drive?
    • JezB
      JezB over 11 years
      It's local - C:\MySQL_Backups\20130112\ etc.
    • BruceWayne
      BruceWayne over 6 years
      So 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 just False.
  • JezB
    JezB over 11 years
    It's definitely a permissions issue - if I set the folder to allow Everyone full control, it works...
  • JezB
    JezB over 11 years
    Correction - I can delete files, but not the folders...
  • Ansgar Wiechers
    Ansgar Wiechers over 11 years
    Check 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
    Mjukilop over 6 years
    Perfect, this is just what I need. Thank you.