Re: Help with listing Folders and Subfolders

From: James M (JamesM_at_discussions.microsoft.com)
Date: 03/01/05


Date: Tue, 1 Mar 2005 12:15:13 -0800

The folders are 3 deep and the program that it gets archived to can only
handle 2 levels.

\date\folder1
\date\folder2
\date\folder2\sub1
\date\folder2\sub2
\date\folder3

The sub1 and sub2 are too deep and will be discarded unless we move them up
to the folder level. We are doing this manually now and are trying to find a
way to script this.

"Jerold Schulman" wrote:

> On Tue, 1 Mar 2005 08:59:03 -0800, "James M" <JamesM@discussions.microsoft.com> wrote:
>
> >Does anyone know of a script that will recurrsively run thu a folder and list
> >all of the folders?
> >
> >And how would I be able to have it automatically move any folders that are
> >too deep and move them up?
> >
> >
> >
>
> Move them where? Define 'too deep'?
>
> To display the list.
>
> @echo off
> if {%1}=={} @echo Syntax RecurseDir ParentFolder&goto :EOF
> if not exist %1 @echo Syntax RecurseDir %1 NOT found.&goto :EOF
> setlocal
> PUSHD %1
> set pf=%1
> set pf="%pf:"=%"
> @echo %pf%
> for /F "Tokens=*" %%f in ('dir /b /s /ad') do (
> @echo "%%~nf" "%%f"
> )
> popd
> endlocal
>
> Jerold Schulman
> Windows Server MVP
> JSI, Inc.
> http://www.jsiinc.com
>



Relevant Pages

  • Re: Help with listing Folders and Subfolders
    ... >And how would I be able to have it automatically move any folders that are ... Define 'too deep'? ... Windows Server MVP ...
    (microsoft.public.windows.server.scripting)
  • Re: Utility to delete folders from x days
    ... >Does anyone know if there is any utility or script I can use to delete ... These folders are automatically created based on date. ... MM DD HH MN SS oGMT DST ... Jerold Schulman ...
    (microsoft.public.win2000.file_system)
  • Re: Q about Finding Folders
    ... tell which folders I'm asking Change Desktop to use. ... I just booted from my Snow Leopard Installer DVD and ran Disk ... It found some directory problems but then repaired them. ... you really have a folder hierarchy that runs 500 deep. ...
    (comp.sys.mac.apps)
  • Re: file moving and organisation proplems
    ... Hi, tyrram ... ... I gave up long ago trying to get all my folders to stay the way I put them. ... I try not to nest my folders too deep ... ... There is a new format called EX-FAT that helps with this problem for thumb drives. ...
    (microsoft.public.windows.vista.file_management)
  • Excel save problems
    ... folders with very descriptive names. ... file structure was about 6 deep. ... >they try to save an Excel file, after about 30 seconds, ... >to multiple servers, not just one. ...
    (microsoft.public.excel.misc)

Loading