1
votes

Trying to schedule a task on a Windows Server 2008 R2 box.

I have a vbscript connects to an oracle database to pull data, and I want this to run at intervals.

The vbs is working standalone on the same machine, only when run with 32-bit csript.exe (needs a 32-bit ODBC driver). I can kick the vbs file off with a batch file to call C:\Windows\SysWOW64\cscript.exe "c:\scriptLoc" and it works fine.

But when I try to schedule a task I get the same error I got when trying to run the vbs directly by double clicking - which uses cscript.exe 64-bit (I presume).

I have also tried opening the 32-bit Task Scheduler C:\Windows\SysWOW64\taskschd.msc, and adding the job there, but getting the same results.

Any suggestions?

Thanks

Edit-------------------------------------------------------------------------------------------------------------

The error is that Oracle Client cannot be found, driver is 32-bit and won't work with 64-bit. This error occurs when I manually run vbs with the default cscript.exe, but it all works ok when I manually run with 32-bit cscript.exe

1
What error are you getting? You mentioned an error but not specified which one.Federico Giust

1 Answers

1
votes

The solution for the scheduled task was:-

Start a Program

Program script = C:\Windows\SysWOW64\cscript.exe (which is the 32-bit csscript.exe)

Add Arguments = C:\Scripts\test.vbs (my vbs script to run)

Start in = C:\Windows\SysWOW64\ (run in the 32-bit directory)