Jump to content

how to create GUI window for connecting network file share and adding in the list box

Recommended Posts


I'm new to Script.

-want to create GUI window,it should have drop down list.
-want to add network folder path and save in the list
and.should have  connect button,and it should connect to specified  n/w path using windows credentials.
-Tell now i just created GUI window,Below is the script i tried.Want to know how to enable add button for network path and connect to it.
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <MsgBoxConstants.au3>
Func Main()
Local $iGUIWidth = 600, $iGUIHeight = 500
Local $idListBox,$Add,$Connect
GUICreate("New GUI", $iGUIWidth, $iGUIHeight)
$idListBox = GUICtrlCreateList("List", 10, 10, 400, 200)
$Connect = GUICtrlCreateButton("Connect", 500, 10, 70, 25)
$Add = GUICtrlCreateButton("Add", 500, 40, 70, 25)
; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE

Share this post

Link to post
Share on other sites


Welcome to the AutoIt forum. :)

But please pay attention to where you post - the "Dev Chat" section where you started this thread is not for general support questions. I have moved it for you, but would ask you to be more careful in future. ;)


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

i once made a simple GUI to connect to predefined network shares:


the shares are hard-coded in the script, but you can easily have them stored in a text file, and customize the GUI as you see fit. i used a list instead of a combo because it allows for multiple selection.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#include <EditConstants.au3>

; init application data
Dim $aServers[4][3] ; columns: server name | LVitem ControlID | drive letter

Global $sUserName=''
Global $sPassword=''

; init GUI-related data
Global Const $GUI_W=400
Global Const $GUI_H=300
Global $msg=0

; buid GUI
GUICreate("Connect to External Servers",$GUI_W,$GUI_H)
GUICtrlCreateLabel('User Name:',50,$GUI_H-100+2)
For $i=1 To $aServers[0][0]

; main function
    If $msg=$gButtonOK Then
        For $i=1 To $aServers[0][0]
            If BitAND(GUICtrlRead($aServers[$i][1],1),$GUI_CHECKED) Then DriveMapAdd($aServers[$i][2],$aServers[$i][0],Default,$sUserName,$sPassword)
Edited by orbs

Share this post

Link to post
Share on other sites

how can i add and save the network share path

-when ever i connect to any of the share path,windows should open up without mapping to drive letter.

-I already have access to all the paths,so my windows login works with out user name and pwd window.

Share this post

Link to post
Share on other sites

do you need anything else done except opening a shared folder? if not, it sounds like you do not need a script or GUI at all - just put a few shortcuts on your desktop.

Share this post

Link to post
Share on other sites

Actually i'm looking for GUI window,which i can add share folder path names in the list and when ever i need i should connect to selected path by clicking connect button.
-I'm nt sure wht function should i add to connect.

I attached the screen shot.

Basically i'm looking to add all the network share path in the list,which i have access .so that i can connect easily. 


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

  • Create New...