Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS to call VBS file, stops on WScript.Sleep

Status
Not open for further replies.

KARR

IS-IT--Management
Apr 17, 2003
91
CA
All,

I am trying to create a DTS package that calls a Visual Basic Script (VBS) file which would in turn run and call up a command prompt and "send keys"

Here is the first several lines of the VBS file:
____________________________________________
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "cmd"
WScript.Sleep 500
'Send D:~
WshShell.SendKeys "D:~"
WScript.Sleep 500
____________________________________________

The full script works fine in Windows Explorer.

The SQL result is that it does open the cmd window, but SQL reports back a message:

Error Description: Error Code: 0
Error Description: Object Required: 'WScript'

It seems to be halting with the "WScript.Sleep 500" line.

Does anyone know of a way to tell the system to wait rather then using the Sleep function?

Thanks
Rob



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top