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
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