Folders

Discussion in 'AutoCAD' started by Shoukat, Mar 6, 2004.

  1. Shoukat

    Shoukat Guest

    Is there a way to export all the folder names in a drive (sub folders too) to txt file?

    Regards,
    Shoukat
     
    Shoukat, Mar 6, 2004
    #1
  2. Shoukat

    rewilson Guest

    From the command prompt in windows........do an xcopy of the drive and make the destination a text file. Something like
    xcopy C:\mydrawings "c:\mydrawings\folderlist.txt\" /y
    It should create the text file for you. There letters you add after the /y to include subfolders, put them in a certain order, etc. However, I've forgotten the syntax for all of it, not having worked from the command prompt in quite some time. I'm certain you can find the info on Microsoft's website. HTH
     
    rewilson, Mar 6, 2004
    #2
  3. Shoukat

    ECCAD Guest

    /s is the switch for sub-dir's
    xcopy c:\*.* >alldir.txt /s

    Bob
     
    ECCAD, Mar 6, 2004
    #3
  4. Shoukat

    ECCAD Guest

    Correction: that didn't work.
    Do this:
    In DOS Shell.
    cd\
    dir *. /s >allfiles.lst

    Bob
     
    ECCAD, Mar 6, 2004
    #4
  5. dir ParentDirectory\*.* /ad /on /b /s > TargetFile

    eg:

    dir C:\ACAD\*.* /ad /on /b /s > c:\ACADFolders.txt
     
    michael puckett, Mar 6, 2004
    #5
  6. BTW ... if you are curious about the meaning of the /b /s switches etc. you
    can get help for most DOS commands by passing a /? on the command line:

    eg: dir /? Will print a help screen *like* the following ...

    Code:
    Displays a list of files and subdirectories in a directory.
    
    DIR [drive:][path][filename] [/A[[:]attributes]] [/B]
    [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q]
    [/S] [/T[[:]timefield]] [/W] [/X] [/4]
    
    [drive:][path][filename]
    
    Specifies drive, directory, and/or files to list.
    
    /A          Displays files with specified attributes.
    
    Attributes     D  Directories   R  Read-only files
    H  Hidden files  A  Files ready for archiving
    S  System files  -  Prefix meaning not
    
    /B          Uses bare format (no heading information or
    summary).
    
    /C          Display the thousand separator in file sizes.
    This is the default.  Use /-C to disable display
    of separator.
    
    /D          Same as wide but files are list sorted by column.
    
    /L          Uses lowercase.
    
    /N          New long list format where filenames are on the
    far right.
    
    /O          List by files in sorted order.
    
    Sortorder      D  By date/time (oldest first)
    E  By extension (alphabetic)
    G  Group directories first
    N  By name (alphabetic)
    S  By size (smallest first)
    -  Prefix to reverse order
    
    /P          Pauses after each screenful of information.
    
    /Q          Display the owner of the file.
    
    /S          Displays files in specified directory and all
    subdirectories.
    
    /T          Controls which time field displayed or used for
    sorting.
    
    Timefield      A  Last Access
    C  Creation
    W  Last Written
    
    /W          Uses wide list format.
    
    /X          This displays the short names generated for non
    8dot3 file names.  The format is that of /N with
    the short name inserted before the long name. If
    no short name is present, blanks are displayed in
    its place.
    
    /4          Displays four-digit years
    
    Switches may be preset in the DIRCMD environment variable.
    Override preset switches by prefixing any switch with a hyphen
    (-), for example, /-W.
    
    Cheers.
     
    michael puckett, Mar 6, 2004
    #6
  7. Shoukat

    Joe Burke Guest

    For the lazy crew, see PrintFolder Pro from no-nonsense software.

    http://no-nonsense-software.com/printfolder/

    Joe Burke

     
    Joe Burke, Mar 6, 2004
    #7
  8. Shoukat

    Shoukat Guest

    Well, It works fine but I'm looking for a Vlips code to use in my program..

    Shoukat.
     
    Shoukat, Mar 7, 2004
    #8
  9. Would have helped if you could have spelled that out at the beginning. Look
    at the vl-directory-files function - write a recursive function that will
    drill down thru a specified directory structure. Search this ng, it may have
    already been written.
     
    michael puckett, Mar 7, 2004
    #9
  10. Shoukat

    rewilson Guest

    http://www.mcneel.com/doslib.htm
    From the web site:
    DOSLibâ„¢ is a library of LISP-callable functions that provide Windows operating system and DOS command-line functionality in AutoCAD 2000-2004.
    DOSLib extends LISP programming languages by providing the following functionality:
    Drive handling functions to change between drives and check disk space.
    Path handling functions to manipulate path specifiers.
    Directory handling functions to create, rename, remove and change directories.
    File handling functions to copy, delete, move, and rename files. Functions for getting directory listings, searching and finding multiple instances of files, and changing attributes are provided.
    Print handling functions to get and set default printers, and spool files.
    Initialization file handling functions to manipulate Windows-style initialization (INI) files, and Windows Registry access functions.
    Process handling functions to run internal DOS commands or other programs.
    System inquiry functions, like memory and disk statistics.
    Miscellaneous functions, like changing the system date and time, and displaying Windows message boxes.
    HTH :)
     
    rewilson, Mar 7, 2004
    #10
  11. Shoukat

    John Uhden Guest

    ;; Function to create a tree-structured list of folders
    ;; given the parent folder as a Path.
    ;; Note that using a path of "" or "." or "\\" will exclude
    ;; the drive letter. McNeel's DOSLIB has a DOS_FULLPATH function
    ;; that can return such folders with drive designations.
    ;; (c) John F. Uhden, Cadlantic
    (defun @Folders (Path / Folders @Dirs)
    (defun @Dirs (Path / Dir Dirs)
    (and
    (= (type Path) 'STR)
    (or
    (/= (type DOS_FULLPATH) 'EXRXSUBR)
    (setq Path (DOS_FULLPATH Path))
    )
    (if (wcmatch Path ",*/,*\\")
    (setq Dir Path)
    (setq Dir (strcat Path "\\"))
    )
    (setq Dirs (vl-directory-files Dir "*.*" -1))
    (setq Folders (cons Path Folders))
    (setq Dirs (vl-remove-if '(lambda (x)(vl-position x '("." ".."))) Dirs))
    (mapcar '@Dirs (mapcar '(lambda (x)(strcat Dir x)) Dirs))
    )
    )
    (@Dirs Path)
    (reverse Folders)
    )
     
    John Uhden, Mar 7, 2004
    #11
  12. Shoukat

    ECCAD Guest

    Shoukat,
    I have a VB program that will allow selection of Drive and/or Folder, makes a list of all Folders (.txt file) from selected Drive or Drive\Folder. Just needs an 'Appload' in VLisp to pull it up on screen. If you want, I can send it to you. Just give me an E-Mail at: . No charge.

    Cheers
    Bob Shaw
     
    ECCAD, Mar 7, 2004
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.