Bert Posted January 15, 2006 Share Posted January 15, 2006 In learning Autoit, I used for the first time FileOpenDialog in one of my scripts. I found that it works well for what I needed it to do. However, I did notice a small problem. When I go to select a folder, I can select things like "My Computer", or "Network Places", or even the recycle bin. I know I can use CLSID to handle the problem, but that will take some doing. Does anyone have a snippit of code that weeds out these things so you can only select a folder? I'm working with another Autoit enthusiast to design a program, and I discovered this problem. We like to address it and have it fixed before we test the beta. Any thoughts? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
pecloe Posted January 15, 2006 Share Posted January 15, 2006 is this what your looking for $var = FileSelectFolder("Choose a folder.", "") phil Link to comment Share on other sites More sharing options...
Bert Posted January 16, 2006 Author Share Posted January 16, 2006 not quite. When you use FileOpenDialog, you can select things like My Computer as a file if you have your desktop as the root. As a work around, I used My Computer as root, and the following code. It is somewhat messy, but it does do what I need it to do. If My computer or Control panel is selected, the user will get a error box, then is given the FileOpenDialog again to correct the error. Case $msg1 = $Wlog1;Button to select file for log $chk = GUICtrlRead($Wlog2) GUICtrlSetState($Wbutton1, $GUI_ENABLE) $selectFDR = FileSelectFolder("Select path to folder where you want to keep log file", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 1 + 2 + 4, @HomeDrive) If $selectFDR = "My Computer" then MsgBox(0, "Error", "You must select a Folder or Drive", 3) $selectFDR = FileSelectFolder("Select path to folder where you want to keep log file", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 1 + 2 + 4, @HomeDrive) endif If $selectFDR = "Control Panel" then MsgBox(0, "Error", "You must select a Folder or Drive", 3) $selectFDR = FileSelectFolder("Select path to folder where you want to keep log file", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 1 + 2 + 4, @HomeDrive) endif if StringLen($selectFDR) = 0 then GUICtrlSetData($Wlog2, $chk) else GUICtrlSetData($Wlog2, $selectFDR) endif The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Swimming_Bird Posted July 27, 2006 Share Posted July 27, 2006 where can i find a list of all the SID's for the different built in directories? 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