General discussion


Window XP Scheduler problem

By ttchu ·
I have a simple VBScript that calls up MS Excel, and runs an Excel macro to format some data. This script, as listed below, runs fine if I start it manually or scheduled it to run when I am logged on as a regular user (i.e. without Admin priviledge). If I leave the machine on, but without logging on, the Windows Scheduler will show the script started but never end. I think it fails to start MS Excel. The only work around, and I have tried this it works, is to schedule the script to run under an id/password with Admin privilege.

Is this a security related issue? How can I workaround this other than running the script with Admin privilege?


**** VBScript in question ****
Shared_Folder = "C:\RMM\Reports"
' Create Log File if it doesn't already exist
LogFilePath = Shared_FOlder & "\Mid-Week LogFile.txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
SET oLogFile = oFSO.CreateTextFile(LogFilePath, True)
oLogFile.WriteLine("Log File Initially Created : " &Date &" - " &Time)

Dim ObjAccess
Dim ObjExcel

' Open Excel to update all traffic reports
oLogFile.WriteLine("MS Excel Started: " &Date &" - " &Time)
Set ObjExcel = CreateObject("EXCEL.APPLICATION")
ObjExcel.Run ("'C:\RMM\REPORTS\Update All Reports.xls'!Update_Traffic_Reports")
Set ObjExcel = Nothing
oLogFile.WriteLine("MS Excel Finished: " &Date &" - " &Time)

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by jc2it In reply to Window XP Scheduler probl ...

Why not set up a user and give it administrator privileges? Then you could run it as that user at night.

Your macro is the problem.

"...GUI macros, i.e. ones that control the mouse and keyboard and 'watch' Windows and perform tasks with other Windows, will NOT work when the machine is logged off. "

Here is the source:

Collapse -

by ttchu In reply to

Thanks for the guidance. The Excel macros do not seem to be the problem. The macro does not require any i/o or GUI interaction. I did some more research and debugging. Turned out the problem has to do with the default set up in the Windows Component Service, which by default, I think, only allows id with Admin Privilege to launch a program as a service. I found a message in the Microsoft newsgroup with the instruction on how to change the configuration. It works.

Here's the link if you are interested.

Collapse -

by ttchu In reply to Window XP Scheduler probl ...

This question was closed by the author

Related Discussions

Related Forums