This command (all on one line)

FOR /F "eol= tokens=1,* delims=/" %%I in
(GFPSAdmin\dirlist.txt) do if exist .\users\%%I\Main.inf dir
.\users\%%I\Main.inf>>GFPSAdmin\datetemp.log

will traverse though the users folder (contents of dirlist) and perform the dir 
command only if main.inf exists in that users directory.  Works like I want.  
Hopefully what someone knows is how to get the two lines like this:

Directory of D:\testbatch\users\test_user2
06/06/01� 03:17p���13 main.inf

onto one line like this:
test_user2�� 06/06/01� 03:17p

bob

On Thursday, June 7, 2001 8:48 PM, Patrick Mathews <[EMAIL PROTECTED]> wrote:
>
>y' needs ta redirect da output a' da dir cmd to a text file, or
>use poil dat stanz fa pawtabul eclectic rubbish lista. web guys
>use da ting ta make cgi's an' stuff like� logon scrip's. do it like dis:
>�
>dir foo.txt >>foo.txt, dis will recurse so dat da output is not
>so bawing. i'm easy to entertain ova heah. good luck.
>
>----- Original Message -----
> From: Bob McGregor <mailto:[EMAIL PROTECTED]>
> To: IMailList <mailto:[EMAIL PROTECTED]>
> Sent: Thursday, June 07, 2001 05:11 PM
> Subject: [IMail Forum] Batch file for checking the Info
>Manager dates
>
>Hi,
>
>I am trying to create a batch file that can run against the
>users directory in the IMail folder to identify accounts that
>have an Info Manager message(main.inf file). -- Easy part...
>
>Next I want to get the create date of the main.inf file so we
>will know when it was created so we can time the deletion of
>the account.� Here's an example of where I am now with the
>batch file:
>
>�Directory of D:\testbatch\users\test_user2
>06/06/01� 03:17p������������������� 13 main.inf
>�Directory of D:\testbatch\users\test_user3
>06/06/01� 03:17p������������������� 13 main.inf
>�
>What I'd like to do now and am� not sure how to proceed is to
>parce the info so I can get the folder name(user id) and
>date/time onto a single line so we have a good list to work
>from.
>
>Here's what I'd like the resulting file to look like:
>
>test_user2�� 06/06/01� 03:17p
>test_user3�� 06/06/01� 03/17p
>
>here's what I have now:
>________________________________
>@echo off
>
>echo.
>echo This batch is an attempt to locate those users that have a main.inf
>echo file in their users directory and then retrieve the date created of
>echo of the so we know how long they have been inactive.
>echo That way we'll know when we can remove the account.
>echo.
>echo For testing, I have a testbatch folder instead of the imail folder.
>echo GFPSAdmin is a folder for storing various sysadmin stuff
>echo .
>rem pause
>d:
>cd \testbatch
>rem building userlist based on directory only
>dir /B /AD users>GFPSAdmin\dirlist.txt
>echo.>GFPSAdmin\datetemp.log
>
>echo Please wait while the file is copied to all directories
>...
>
>rem This for loop loops through the dirlist.txt file looking for the filename
>rem main.inf in each folder in the file.� If it finds it, it does a dir main.inf
>rem to the folder so I get the date and filename.
>rem Note that this command(next two lines) must all be on one
>single line:
>
>FOR /F "eol= tokens=1,* delims=/" %%I in
>(GFPSAdmin\dirlist.txt) do if exist .\users\%%I\Main.inf dir
>.\users\%%I\Main.inf>>GFPSAdmin\datetemp.log
>
>rem Now, parse through the above file and get out the user and date of the main.inf 
>creation
>cd GFPSAdmin
>findstr "\users\ main.inf" datetemp.log > datetest.log
>del datetemp.log
>
>rem echo Check file GFPSAdmin\datetest.log for details.
>rem echo.
>---------------------------------
>thanks, bob
>
>
>
>
>
>Please visit http://www.ipswitch.com/support/mailing-lists.html
><http://www.ipswitch.com/support/mailing-lists.html>
>to be removed from this list.
>
>An Archive of this list is available at:
>http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
><http://www.mail-archive.com/imail_forum%40list.ipswitch.com/>
>


Please visit http://www.ipswitch.com/support/mailing-lists.html
to be removed from this list.

An Archive of this list is available at:
http://www.mail-archive.com/imail_forum%40list.ipswitch.com/

Reply via email to