Jump to content
Sign in to follow this  
Starstar

How can i check gave directory is wright or not?in brows input.

Recommended Posts

Starstar

How can i check gave directory is wright or not?in browse input.

#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 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."

Share this post


Link to post
Share on other sites
MouseSpotter

Have you tried this search "get directory permissions"

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Starstar

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 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."

Share this post


Link to post
Share on other sites
Starstar

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."

Share this post


Link to post
Share on other sites
Melba23

adnanbaloch,

I want to check that directory is exists or not

If 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._______My UDFs:

Spoiler

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
Starstar

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."

Share this post


Link to post
Share on other sites
Melba23

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 flag

And 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._______My UDFs:

Spoiler

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
Starstar

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."

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  

×