Re: script will not run as a scheduled service unless logged on
- From: "Al Dunbar" <AlanDrub@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 4 Jul 2007 21:41:00 -0600
"C.W." <c.w@xxxxxxxxxx> wrote in message
news:euh$xwkvHHA.3500@xxxxxxxxxxxxxxxxxxxxxxx
Hi
I have run into a really bizzare issue. I have created a vbscript that
refreshes pivot tables and database queries on excel spreadsheets. I can
run the script interactively, and I can run the script as a scheduled job
so long I am logged on.
OK, at this point, when you say *you* are logged on, what account are you
logged into? And below you say the scheduled task is configured to use the
domain administrator's account - is this the case in the scenario you
describe above?
BTW, is there any difference between calling
CreateObject vs WScript.CreateObject in a vbscript?
I believe that there is a difference, and recall it was discussed here years
ago, but for the life of me I do not remember the details. I think the two
functions attache slightly different meanings to the parameters provided.
The command line of the script is
cscript "J:\Reports\SS Report Engine\GenerateReports.vbs" 0 1
I assume that the .vbs accepts and processes the two parameters, zero and
one. Are you sure that these are being passed to the script when it runs as
a scheduled job?
The job is set up in the task scheduler to use the domain administrator
account. The task scheduler log does not report the detail of the error.
From what I can see the script failed to run completely as I create an
entry to the application log on the first line of the script. The exit
code is 1.
depending on how long the job takes to run, you might need to specify a
longer than default timeout parameter to cscript.
I have already given Batch user full access to cscript.exe,
There is no reason in the world why this would be necessary or useful. You
only need read and execute permission. But, what do you mean by the "batch
user" - is this the domain admin account?
and I have also assigned the domain administrator account right to log
on as a batch job in local security policy -> user right assignment.
I would have thought that an administrator would already have all the rights
necessary to do virtually anything.
Anyway, if your script ran up to the point where it created the application
log entry before you made these permissions/rights changes, then I would
suggest they were not necessary.
So, what else does your script actually do, in general terms. Perhaps
something it does can only be done in an interactive environment.
/Al
.
- Follow-Ups:
- References:
- Prev by Date: Re: Message Box
- Next by Date: Re: help combine three scripts to create a log server
- Previous by thread: script will not run as a scheduled service unless logged on
- Next by thread: Re: script will not run as a scheduled service unless logged on
- Index(es):