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

DFS Shares

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
GB
Hello all,
Anyone know how to tell which server you are connected to when you map to a dfs share?
at the moment we have a text file on each server which has to be read before you can tell which server the user is actually looking at! not very nice.
any ideas???

thanks
von moyla
 
ok, i have an exe which displays the dfs info

cmd line syntax of

dfsutil /pktinfo

My next question is how do i use the Exec method to execute this command and get a refernce to its STDOUT
I dont want to have to pipe it to a text file and then read the text file????

Thanks,
von moyla
 
If FSO.FileExists("c:\win\system32\dfsutil.exe") Then
Dim oExec
Dim blnSectionFound
Dim sLine
Set oExec = WshShell.Exec("c:\win\system32\dfsutil.exe /pktinfo")
blnSectionFound = False
Do While Not oExec.StdOut.AtEndOfStream
sLine = LCase(Trim(oExec.StdOut.ReadLine))
'msgbox sLine
If sLine = "entry: \fsc.net\dfsroot\software" Then
blnSectionFound = True
End If
If blnSectionFound = True Then
If Right(sLine, 10) = "( active )" Then
If InStr(sLine, "[\") > 0 Then
strDFSServer = Mid(sLine, InStr(sLine, "[\") + 2, Instr(InStr(sLine, "[\") + 2, sLine, "\") - InStr(sLine, "[\") - 2)
End If
End If
End If
Loop
Set oExec = Nothing
Else
'could always try the sname.ini file if the above didnt work
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top