Page 1 of 1

Problem running VB Script with HouseBot

Posted: Mon Feb 02, 2009 7:17 pm
by kzpbb2
Shown below is a snippet of code that runs without error when I run it outside of HouseBot. When I run it from a HouseBot Task, the compiler gives me an error....."Variable is undefined: WScript" and points to the last line shown below. Any ideas why or how to fix? Note - I do NOT use a C: drive letter designation. My bootable (and Windows) drive is letter E: Thanks for any feedback.

Option Explicit
Dim strText, sPath, oFSO, oFolder, oFiles, bolFileIsNewEnough, dFileModDate, oFile, PopInfo, WshShell

sPath = "E:\Documents and Settings\_kzpbb2\Desktop\Scanner Audio Files"

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")

Re: Problem running VB Script with HouseBot

Posted: Mon Feb 02, 2009 11:54 pm
by Osler
You can not invoke WScript from within the HouseBot scripting host. Most of the things you would need WScript for are already included within HouseBot (i.e., use Sleep(int) instead of WScript.Sleep(int)). If you have a script that absolutely must use WScript, invoke it using a Execute Program device and CScript.exe using command line variables to pass the path to the script.

Osler

Re: Problem running VB Script with HouseBot

Posted: Tue Feb 03, 2009 3:11 am
by Richard Naninck
One small hint: If you would have put WScript in the search window of this forum, all of the answers you need pop up!

Re: Problem running VB Script with HouseBot

Posted: Tue Feb 03, 2009 3:09 pm
by kzpbb2
Thanks to Osler and Richard Naninck for their advice and guidance. I greatly appreciate your help. I can now run my script without error. From you I've learned a little better how HouseBot works and improved my search skills in this forum. Thanks again.