Error Querying ADSI via VBScript: "The Network Path Was Not Found" 
Author Message
 Error Querying ADSI via VBScript: "The Network Path Was Not Found"

I'm trying to determine how many licences of a particular software package
our users are using...

I'm doing this by checking if a particular file exist on their machines by
querying via ADSI in VBScript. The code is at the end of this msg...

I started to make some real progress, but after adding a few bits of code to
check a few things out (nothing significant) I get an error:
"PdfSpy2.vbs(44, 3) (null): The network path was not found.".

If I comment out the code concerned (see label *A*), it works... However, if
I add in the code at label *B*, I get the same error at that line later
on... The code is valid as far as I am concerned; I think that the program
is getting confused/overloaded or such-like...

Any ideas?



Option Explicit

Dim oDomain, oPC

Dim S, M

Dim sPath

Dim oFSO, oFile, oLog

Dim sOS, x

Function Lpad(S,N)

If IsNumeric(N) Then

Lpad = S & Space(N-Len(S))


Lpad = S

End if

End Function

Function Rpad(S,N)

If IsNumeric(N) Then

Rpad = Space(N-Len(S)) & S


Rpad = S

End if

End Function

Function FormatKilo(N)

FormatKilo = FormatNumber((N/(1024)),0)

End Function

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set oDomain = GetObject("WinNT://HEXADEX")

Set oLog = oFSO.CreateTextFile("PDFLog.txt",true)

oDomain.Filter = Array("Computer")


Wscript.Echo "Starting...."


For Each oPC In oDomain


S = oPC.Name

If Right(oPC.OperatingSystemVersion,4) = "v5.0" Then                *A*




End if

sPath = "\\" & oPC.Name & "\C$\" & sOS

If oFSO.FolderExists(sPath) Then

WScript.Echo x & ": " & Lpad(S,18) & " - no prog files"


sPath = "\\" & oPC.Name & "\C$\" & sOS &

If oFSO.FileExists(sPath) Then

M = ""

M = M & Lpad(S,18) & Lpad(oFSO.GetFileVersion(sPath),12)

'M = M & oPC.OperatingSystem & " v" & oPC.OperatingSystemVersion         *B*

oLog.WriteLine M

Wscript.Echo x & ": " & M


WScript.Echo x & ": " & Lpad(S,18) & " - n/a"

End If

End If

If x=5 then Exit For



MsgBox ("PDFSpy Completed")

Sun, 26 Jun 2005 20:52:20 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Access '95: "Path Not Found"

2. SysCmd 603, "path","path"

3. ADSI:GetObject network path not found reading info other than the current computer name

4. ADSI: Intermitent Network Path Was Not Found when binding to group

5. Script error: Xtra not found "MUI"

6. Error "Member not found"

7. Script error: Xtra not found "MUI"

8. error: "can not find script file.."

9. The network path was not found error

10. Update Query "Not Updatable" Error

11. "Module not found" error

12. "Module not found" error


Powered by phpBB® Forum Software