Starstar Posted April 29, 2013 Share Posted April 29, 2013 (edited) How can i check gave directory is wright or not?in browse input. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <process.au3> $COMPANY_NAME = "HM-LINK" ; name of the pppoe icon, friendly description $SERVICE_NAME = "HM" ; name of the pppoe service configured in NAS/Mikrotik Local $font $DELAY = 300 $frmInformation = GUICreate($COMPANY_NAME, 287, 230, 193, 115) $btnOK = GUICtrlCreateButton("&GO!", 208, 200, 68, 25, 0) $btnbrw = GUICtrlCreateButton("&Browse", 208, 164, 68, 25, 0) $txtbrw = GUICtrlCreateInput("", 118, 164, 80, 21) $lblbrw = GUICtrlCreateLabel("Select Icon:", 16, 169, 80, 17) GUISetState(@SW_SHOW) While 1 $uMsg = GUIGetMsg() Switch $uMsg Case $btnbrw Local $message = "Hold down Ctrl or Shift to choose multiple files." Local $var = FileOpenDialog($message, @WindowsDir & "\", "Icon (*.Ico;*.bmp)", 1 + 4) If @error Then MsgBox(0, "", "No Icon chosen") Else $var = StringReplace($var, "|", @CRLF) EndIf ControlSetText($COMPANY_NAME,"","[CLASS:Edit; ID:11]",$var) Case $btnOK $txtbrwr = GUICtrlRead($txtbrw) If StringLen($txtbrwr)=0 Then MsgBox(64,$COMPANY_NAME &" 03216592390","Please Choose Hm5 Icon.") Else $txtbrwr = GUICtrlRead($txtbrw) ExitLoop EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GUISetState(@SW_HIDE) Run("control ncpa.cpl") Sleep($DELAY) WinClose("Network Connections") Edited April 29, 2013 by adnanbaloch Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
MouseSpotter Posted April 29, 2013 Share Posted April 29, 2013 Have you tried this search "get directory permissions" Link to comment Share on other sites More sharing options...
water Posted April 29, 2013 Share Posted April 29, 2013 How can i check gave directory is wright or not? in browse input.What do you mean by "is right or not"?That the directory exists or that you have specific permissions (e.g. write) on the directory? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Starstar Posted April 29, 2013 Author Share Posted April 29, 2013 (edited) What do you mean by "is right or not"?That the directory exists or that you have specific permissions (e.g. write) on the directory?I want to check that directory is exists or not>>>>A Gift of thanks For all..... Edited April 29, 2013 by adnanbaloch Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Starstar Posted April 29, 2013 Author Share Posted April 29, 2013 Have you tried this search "get directory permissions"Yes i tried it. But it could not help me.......... Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 29, 2013 Moderators Share Posted April 29, 2013 adnanbaloch,I want to check that directory is exists or notIf this is the directory returned from FileOpenDialog then the directory must exist if it is chosen from the tree. If you allow the user to enter a filepath and name in the dialog input field, then you can ensure the path (and even file) exists by using the "options flag - you can also ask for the file and path to be created if they do not exist. I hope that amswers your question. 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...
Starstar Posted April 29, 2013 Author Share Posted April 29, 2013 Melba23 if the User Browse and find icon for softwhere from FileOpenDialog than it cannot create problem. but when someone type location in dialog input field than it can be go wrong.Therefore i need a command line that can check directory is exists or not, or how can i stope User to type directory in dialog input field? Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted April 29, 2013 Moderators Solution Share Posted April 29, 2013 adnanbaloch, Read what I said in my post above: If you allow the user to enter a filepath and name in the dialog input field, then you can ensure the path (and even file) exists by using the "options flagAnd look at the FileOpenDialog page in the Help file: options [optional] Dialog Options: To use more than one option, add the required values together. 1 = File Must Exist (if user types a filename) 2 = Path Must Exist (if user types a path, ending with a backslash) 4 = Allow MultiSelect 8 = Prompt to Create New File (if does not exist) So using 1 + 2 will prevent the user from manually entering a non-existent path/filename - using 8 will create the file if it does not exist. It sounds as though you want the former. 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...
Starstar Posted April 29, 2013 Author Share Posted April 29, 2013 Thanks Melba23 I think after this my problem will be solve................. Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." 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