Jump to content
Sign in to follow this  
abb

Help needed to Browse for Network Resources

Recommended Posts

abb

I've been looking through the forums and the help file for information on browsing a network for machines but have not been successful.

I am working on a client that can connect to an application running on a remote server. However, instead of having the user enter the machine name or ip address I'd prefer to offer a select drop-down containing all the machine names of servers available on the network.

If you have any thoughts or could point me in the right direction I'd be greatful.

Thank you!

ABB

Share this post


Link to post
Share on other sites
abb

This is what I am currently doing to achieve this but don't think it's the best solution. Please help.

$machineList = GUICtrlCreateCombo("Select ...",77,57,235,200)
$cmdNetView = RunWait(@ComSpec & " /c net view>netview.log", "", @SW_HIDE)
If Not _FileReadToArray("netview.log",$aRecords) Then
   fnWriteLog("Error reading netview.log to array: " & @error)
EndIf
For $x = 1 to $aRecords[0]
   If StringLen($aRecords[$x]) <> 0 Then
      If StringInStr($aRecords[$x],"\\") Then
         $aFoo = StringSplit($aRecords[$x]," ")
         $bar = $bar & $aFoo[1] & "|"
      EndIf
   EndIf
Next
GUICtrlSetData($machineList,$bar)
FileDelete("netview.log")
Edited by abb

Share this post


Link to post
Share on other sites
abb

Anyone have an insight into a better way? Perhaps a native or user AutoIT function?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×