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
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