Jump to content
Sign in to follow this  
mclifford

Select Multiple Folders?

Recommended Posts

mclifford

So far this is what I have, and I can select one folder under Students, but I would like to select multiple folders and store them in a variable that I can read later. From what I can tell from the help file this isn't going to do that for me, but its all that I could come up with so far.

$var = FileSelectFolder("Choose a folder(s).", "C:\Students" )

MsgBox(4096, "Test", ""& $var &"", 10)

Any help would be appreciated,

Mike

Share this post


Link to post
Share on other sites
zorphnog

There is not any built-in support for this. What exactly are you trying to do? Can you not just have the user select a folder and then iterate through that folder structure to determine the rest of the folders? A description of the 'bigger picture' of what you are trying to accomplish may help in determining a solution for you.

Share this post


Link to post
Share on other sites
spudw2k

Sounds like you'll have to build a gui with a treeview and populate it with the directories you'll want to be able to select from in oder to accomplish what you need.

Share this post


Link to post
Share on other sites
mclifford

There is not any built-in support for this. What exactly are you trying to do? Can you not just have the user select a folder and then iterate through that folder structure to determine the rest of the folders? A description of the 'bigger picture' of what you are trying to accomplish may help in determining a solution for you.

Teachers are wanting to copy a file(s) to students desktops when they login. We used to have an old program that did this, but we've moved away from it and I was trying to come up with something to do this for them again. My idea was for them to select the home directories from the students drive and then do something else that will copy those file(s) to the selected students, but I haven't come up with how the second half will work since I couldn't even get the first part to work.

So I want the teachers to be able to select the home directories on one side of the program and the file(s) they want to copy on the other side and then store that information and run the second half of the program or store that information for another program to read when the students login that will check to see if there ID is in the file and then copy the file(s) associated with them.

That is the basic idea, I just can't even get the first part to work.

Thanks,

Mike

Share this post


Link to post
Share on other sites
PsaltyDS

That is the basic idea, I just can't even get the first part to work.

Well, this should get you started:
#include <File.au3>
#include <Array.au3> ; Only for _ArrayDisplay()

Global $sStudentDir = "C:\Students"
Global $avDirList = _FileListToArray($sStudentDir, "*", 2) ; 2 = Folders only
If @error = 0 And IsArray($avDirList) Then
    _ArrayDisplay($avDirList, "$avDirList")
Else
    MsgBox(16, "Error", "Error listing directories.")
    Exit
EndIf

:)

Edit: Typo

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
mclifford

Well, this should get you started

Cool, this looks like what I was trying to do, thanks for the help.

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  

×