Re: Help with listing Folders and Subfolders
From: James M (JamesM_at_discussions.microsoft.com)
Date: 03/01/05
- Next message: Marco Shaw: "Automating GUI logins"
- Previous message: Javier J: "Re: Deny _WRITE_ access to a file"
- In reply to: Jerold Schulman: "Re: Help with listing Folders and Subfolders"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: Marco Shaw: "Automating GUI logins"
- Previous message: Javier J: "Re: Deny _WRITE_ access to a file"
- In reply to: Jerold Schulman: "Re: Help with listing Folders and Subfolders"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|