Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
excuse my english.
what i tray to do is :
to connect some Servers on the D- Drive and look for a special File in a DATE and to find first :
was the BAckup successfully or incomplead ?my way :
echo please give the searced Day in Form dd.mm.jj
set /P Datum=FOR /F "tokens=1" %%i in (Serverliste.txt) do (
net use \\%%i\D$\ARCserve2000\LOG
dir \\%%i\D$\ARCserve2000\LOG /TW | findstr "J00" | findstr "%Datum%">Datum.txt
)
pauseFOR /F "tokens=1" %%k in (Datum.txt) do (
findstr "Succesfull" >Successfull.txt
)but it does not work !
Please help me

I miss the logic of the script, I mean, it's not a source trouble like mispelled cmd or anything, it's just that it shouldn't work anyway - you first get the lines from the dir listing which have the specified date to a text file. Then, you look for the string 'Succesful' on that file. Why do you expect that file (datum.txt) do have the strings 'Sucessfull'?
I'm not even sure of what you're trying to do here... Anyway, the following script will find the files on a certain directory (that LOG folder based on the server list) with extention .J00 that were written on the inputed date, and display them. If no files were found, it will display the messages "No files found":
@echo off
if exist %0.bat %0.bat
setlocal
set Datum=
for %%F in (%0) do (
for /F "tokens=1" %%D in ("%%~tF") do (
set Gauge=%%D
)
)
echo Enter write date of files to be found in format as example - %Gauge%
:input
set /P Datum=
if "%Datum%"=="" goto input
set found=0for /F "tokens=1" %%S in (Serverliste.txt) do (
net use \\%%S\D$\ARCserve2000\LOG
for %%F in (\\%%S\D$\ARCserve2000\LOG\*.J00) do (
for /F "tokens=1" %%D in ("%%~tF") do (
if "%%D"=="%DATUM%" (echo %%F&set found=1)
)
)
)if "%found%"=="0" echo File not found.
endlocalI hope that helps you.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br_______________________________________________________________________________

![]() |
Making a .bat file to get...
|
DOS and Win 2k partition
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |