General discussion

Locked

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?

--
Teddy

**** 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(LogLine)
oLogFile.WriteLine("Log File Initially Created : " &Date &" - " &Time)
oLogFile.WriteLine(LogLine)

Dim ObjAccess
Dim ObjExcel


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

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| 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:
http://www.mjtnet.com/?msfaq6.html

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.
http://groups.google.com/group/microsoft.public.inetserver.iis/browse_thread/thread/b37f7bc3e297867/b5cf9c1541e8d615?lnk=st&q=VBscript+Permission+Denied+CreateObject+Excel&rnum=1#b5cf9c1541e8d615

Collapse -

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

This question was closed by the author

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums