April 1, 2002 at 12:40 pm
I wrote a script to determine the amount of free space on a given drive on a given server (code section shown below):
...
...
Dim oFS, oDrive
set oFS = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = Wscript.CreateObject("Wscript.Network")
WshNetwork.MapNetworkDrive "m:", "\\bill\c$"
set oDrive = oFS.Drives("m:")
SizeMB = oDrive.AvailableSpace/(1024*1024)
SizeGB = SizeMB /1024
MsgBox CStr( FormatNumber(SizeGB,2,,,True)) + " GB"
WshNetwork.RemoveNetworkDrive "m:"
...
...
I want to take the info generated from each server, store it in a table called DiskFreeSpace, and run the process daily. I thought I could use DTS (under Sql 2k). The above script parses fine under DTS but when I run it under DTS I get the error: "Object required: Wscript" and DTS stops.
Any thoughts on how to get it working?
TIA,
Bill Salkin
April 1, 2002 at 10:03 pm
Is Windows Script Host installed on your SQL Server? If not, that explains the failure because the object Wscript is part of WSH 1.0 and higher. The parse check only looks at syntax. It doesn't evaluate whether or not the objects you are declaring actually are present on the server.
K. Brian Kelley
http://www.sqlservercentral.com/columnists/bkelley/
K. Brian Kelley
@kbriankelley
April 1, 2002 at 11:20 pm
Brian,
Yes the Windows Scripting Host is installed on the Sql server. And I can run the heart of that code as a VB script module on the same Sql box that refused to run the DTS script. Go figure.
Bill
April 2, 2002 at 5:15 am
Hey Bill,
This isn't an answer, but maybe will help anyway - you could run it as .vbs and write the results to a file (or even throw in ADO and write it directly to your table) and then import it.
Andy
April 2, 2002 at 5:38 am
How is Agent configured as far as account runs under. It may not have the enough rights to access the file system and most likely unless you have an account that exists on the mapped server it cannot even connect to the server. There have been many threads here about using mapped drives which point that you need to have Agent under a Domain account with access to and permissions on the remote server.
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply