"Matthias Tacke" <(E-Mail Removed)> wrote in message news:<cgig78$6rg$02$(E-Mail Removed)>...
> Charles Theodore wrote:
>
> >Hi everyone,
> >
> >Running Windows XP pro and looking for a way to make my batch optimized.
> >
> >--------------------------actual code----------------------------------
> >@echo off
> >set pathx=\\filesrv1\MSI\Graphic
> <snip>
>
> This doesn't sound like a repititous task, so why not create a dir
> listing with folders only and edit it?
>
> Your description remains unclear, do you want only the "leaves" in your
> tree to contain that "input" folder ?
>
> This is not tested.
> :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> @echo off
> setlocal
> set pathx=\\filesrv1\MSI
> for /f "delims=" %%A in ('dir /B/S/AD %pathx%') do call :sub "%%A"
> goto :eof
> :sub
> :: check if this is an INPUT folder
> if /I "%~nx1" EQU "INPUT" goto :eof
> :: check if already present
> if exist "%~1\INPUT" goto :eof
> :: check for leaves
> for /F "delims=" %%B in ('dir /B/S/AD %1') do goto :eof
> md "%~1\INPUT"
> :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>
> HTH
To your question1: How do you see that? I'm not sure to exactly
understand
your proposition :-(
To your question2: Yes, that's correct!
When i run your script, it works great to create the INPUT directory
when the directory is already empty or contain a filename (for
example, the Photoshop dir.). When the dir have already a
sub-directory, it doesn't work.
Let me show exactly the problem with an example:
\\filesrv1\MSI\Graphic\Photoshop\(if that dir is empty, creation of
INPUT work)
\\filesrv1\MSI\Graphic\Photoshop\(if that dir have a filename,
creation of INPUT work)
\\filesrv1\MSI\Graphic\Photoshop\(if that dir have a sub-directory,
it doesn't work to create the INPUT directory)
Thank you, for help !!!
Charles
|