srikanthreddy29 Posted March 3, 2015 Share Posted March 3, 2015 Hi, 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> Main() Func Main() Local $iGUIWidth = 600, $iGUIHeight = 500 Local$Add 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) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 3, 2015 Moderators Share Posted March 3, 2015 srikanthreddy29,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. M23 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: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
orbs Posted March 3, 2015 Share Posted March 3, 2015 (edited) 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. expandcollapse popup#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 $aServers[0][0]=3 $aServers[1][0]='server1\share' $aServers[2][0]='server2\share' $aServers[3][0]='server3\share' $aServers[1][2]='X:' $aServers[2][2]='Y:' $aServers[3][2]='Z:' 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) GUISetBkColor(0x444444) $gServers=GUICtrlCreateListView('Drive|Server',10,10,$GUI_W-20,$GUI_H-120,Default,$LVS_EX_CHECKBOXES) GUICtrlCreateLabel('User Name:',50,$GUI_H-100+2) GUICtrlSetColor(-1,0xFFFFFF) GUICtrlCreateLabel('Password:',50,$GUI_H-70-2) GUICtrlSetColor(-1,0xFFFFFF) $gUserName=GUICtrlCreateInput('',110,$GUI_H-103+2,$GUI_W-220,20) $gPassword=GUICtrlCreateInput('',110,$GUI_H-73-2,$GUI_W-220,20,BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) For $i=1 To $aServers[0][0] $aServers[$i][1]=GUICtrlCreateListViewItem($aServers[$i][2]&'|'&$aServers[$i][0],$gServers) Next $gButtonOK=GUICtrlCreateButton('Connect',110,$GUI_H-40,$GUI_W-220,30) GUICtrlSetState($gButtonOK,$GUI_DEFBUTTON) GUISetState() ; main function Do $msg=GUIGetMsg() If $msg=$gButtonOK Then $sUserName='EXTERNALDOMAIN\'&GUICtrlRead($gUserName) $sPassword=GUICtrlRead($gPassword) 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) Next Exit EndIf Until $msg=$GUI_EVENT_CLOSE Edited March 3, 2015 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
srikanthreddy29 Posted March 4, 2015 Author Share Posted March 4, 2015 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. Link to comment Share on other sites More sharing options...
orbs Posted March 4, 2015 Share Posted March 4, 2015 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. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
srikanthreddy29 Posted March 5, 2015 Author Share Posted March 5, 2015 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. Link to comment Share on other sites More sharing options...
srikanthreddy29 Posted March 9, 2015 Author Share Posted March 9, 2015 Hey orbs ...can u help me... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now