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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNC names with FileSystemObject

Status
Not open for further replies.

Niall

MIS
Feb 8, 1999
1
GB
According to the VBScript documentation, it is possible to query disk attributes of volumes declared in UNC format. I am using the following code to get information of the C: drives of a number of remote servers. I get an error indicating "Path not found" on the "set objDrive=objFSO.GetDrive(Drive)" statement:<br>
<br>
Dim objConn<br>
Dim objRS<br>
Dim objFSO<br>
Dim objDrive<br>
set objFSO=CreateObject("Scripting.FileSystemObject")<br>
set objConn=Server.CreateObject("ADODB.Connection")<br>
objConn.Open "DSN=ServerMetrics;uid=sa;pwd="<br>
<br>
SQLstmt="SELECT servername from servers order by servername"<br>
<br>
set objRS=objConn.Execute(SQLstmt)<br>
<br>
do until objRS.EOF<br>
SrvDrive="\\" & objRS(0) & "\C$"<br>
Response.Write SrvDrive & "&lt;BR&gt;"<br>
Drive=objFSO.GetDriveName(SrvDrive)<br>
set objDrive=objFSO.GetDrive(Drive)<br>
Free=objDrive.Freespace<br>
Total=objDrive.Totalsize<br>
Loop<br>
<br>
TIA,<br>
Niall.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top