selecting/creating dir via user input ? 
Author Message
 selecting/creating dir via user input ?

I'm new at all this scripting stuff, but I routinely need to
sort a bunch of files into directories based on the first few
chars in their name.  I've got most of the basic idea sorted and
think with a bit (lot) of debugging I can make it work but what
I really need now is a way to select which folder/s the script
will sort.
Is there a way I can make a directory list popup for the user to
select a directory for sorting? (something like the "add
directory to playlist" dialog box that winamp uses)

need to select sort_dir from existing folders, but dupe_dir may
not exist, so must give user option to create it if possible.

//sample code... somewhat primitive
Function ShowFolderList(sort_dir)
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFolder(sort_dir)
  Set fc = f.Files
  For Each f1 in fc
  set ref_num = left(f1, 5)
  if (fso.FolderExists(ref_num)) then
   if (fso.FileExists(ref_num\f1)) then
    fso.MoveFile(f1, ref_num)
   else
    fso.MoveFile(f1, dupes_dir)
   endif
  else
   fso.CreateFolder(ref_num)
   fso.MoveFile(f1, ref_num)
  endif
else
  Next
End Function
-----

-----------------------------------------------------------

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.*-*-*.com/



Tue, 17 Dec 2002 03:00:00 GMT  
 selecting/creating dir via user input ?
If you can assume the user has Active Desktop, then go to

Win32 Scripting [Clarence Washington]
http://cwashington.netreach.net
http://cwashington.netreach.net/script_repository/repository.asp

and search for: BrowseForFolder
===> http://cwashington.netreach.net/script_repository/query.asp

http://cwashington.netreach.net/main_site/downloads
http://cwashington.netreach.net/script_repository/faqs.asp?topic=wmifaq
http://cwashington.netreach.net/script_repository/faqs.asp?topic=adsifaq

--
Michael Harris
MVP Scripting


I'm new at all this scripting stuff, but I routinely need to
sort a bunch of files into directories based on the first few
chars in their name.  I've got most of the basic idea sorted and
think with a bit (lot) of debugging I can make it work but what
I really need now is a way to select which folder/s the script
will sort.
Is there a way I can make a directory list popup for the user to
select a directory for sorting? (something like the "add
directory to playlist" dialog box that winamp uses)

need to select sort_dir from existing folders, but dupe_dir may
not exist, so must give user option to create it if possible.

file://sample code... somewhat primitive
Function ShowFolderList(sort_dir)
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFolder(sort_dir)
  Set fc = f.Files
  For Each f1 in fc
  set ref_num = left(f1, 5)
  if (fso.FolderExists(ref_num)) then
   if (fso.FileExists(ref_num\f1)) then
    fso.MoveFile(f1, ref_num)
   else
    fso.MoveFile(f1, dupes_dir)
   endif
  else
   fso.CreateFolder(ref_num)
   fso.MoveFile(f1, ref_num)
  endif
else
  Next
End Function
-----

-----------------------------------------------------------

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



Tue, 17 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Control for user input via Gantt chart?

2. Select every "n"th record looped from user input

3. Search/select item in ComboBox based on user input

4. Need help creating user dir., then setting specific permissions for it

5. datareport on selected records using a user input

6. create nt user and share it's home dir

7. Creating text file using input via HTML

8. SELECT lists and user input - help!

9. allow user input in select box

10. How to Dynamically Create a new .ASP Document based on user input

11. Can I create a listbox for user input?

12. Creating a DUN profile without user input

 

 
Powered by phpBB® Forum Software