All Forums >> [Scripting] >> WSH & Client Side VBScript >> Use of IE in scheduled scripts doesn't work Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
At work i use CADminTools for Flexlm license monitoring. CADminTools is written in ASP and uses VBScript. Let me underline that I'm not asking for ASP or IIS help. I'd like to automate a weekly archiving process by using a scheduled .vbs script. I starting with a script launching IE with the path to the asp page out of the script. This works when I run the script manualy or scheduled as long as a user is logged on the machine or the workstation is at least locked. Now the problem is that the script should also work when no user is logged on the system(!) but it does no't work. The script always works when I'm logged on or the workstation is locked. No difference if I run it manually or by the task scheduler. After finding http://www.microsoft.com/technet/scriptcenter/guide/sas_ent_qpyo.mspx?mfr=true on the internet i tried this but my problem remains. So I wrote a little test script (code see below).
test.asp does the same as the block beginnig with 'For testing only, writing the date and time into a file on the webserver.
lic.asp does some calculation, opens 6 pop ups and writes to a .mdb database file.
Results:
The writing to the local 'test.txt' works
The writing of the remote test.txt works, too
lic.asp + params fails
I guess this might be a permission problem but don't know for sure and i have no idea how to fix this.
I hope somebody has an idea how to fix this.
Cheers Peter
EDIT: corrected reults, added code of test.asp(VBScript)
< Message edited by zpeter -- 3/27/2007 1:42:16 AM >
There are several possible problems with your script issue. One of which is security rights. Who's account have you specified when you run the scheduled task? The bigger problem you might be encountering is the fact that the script may be running with the correct permissions, but may not be loading the profile. Also when there isn't a user logged in there is no WINSTA0/DEFAULT DESKTOP created. It gets created when a user logs in.
I would try using PSEXEC from sysinternals to debug your script. You can schedule the task to have PSEXEC run your script. The new version of PSEXEC will allow you to run applications on the winlogon desktop. So you will be able to see it even if there isn't a user logged in. The Caveat is it has to run as system account. In order to do this you must have admin rights. Also you might have to enable write permissions on the directory to IUSR_machinename so anonymous access can write to the file. This may only be needed for debugging since the system account won't authenticate to IIS properly.