[<<]Message[>>]    [<<]Author        [<<]Subject        [<<]Thread    

Number : 7767 Date : 2004-04-25 Author : PM Subject : Re: Use XXCOPY to Delete Stray Files Size(KB) : 1
John, Thanks very much. That batch file does the trick! Peter > Xxcopy would need a little help from a batch file to do this, > actually you wouldn't need xxcopy at all for a project like this. > > The batch file I have below requires NT or newer systems. It will > not actually delete anything, it just echoes to the screen what it > will delete if you remove the ECHO in the line that begins with IF > NOT EXIST. > > You will want to change the base directory to process the directory > you desire. In this example batch file I have the FOLDER variable > set to process the c:\test directory. > > Set FOLDER=c:\test > > It file will also process all the subdirectories. > > John > > > :: ========================================== > @echo off > setlocal > > @if not "%OS%"=="Windows_NT" goto NT > > :: SET BASE DIRECTORY TO PROCESS > set FOLDER=c:\test > > for /f "delims=*" %%i in ('dir /a-d/b/s "%FOLDER%\*.idx" 2^> nul') do > (call :doit "%%~dpni") > > pause > goto :eof > > :doit > set X=%1 > set X=%X:"=% > if not exist "%X%.dat" ECHO del "%X%.idx" > goto :eof > > :NT > :DOS_EXIT > echo This script has aborted because it requires Windows NT > echo: > echo: > echo Press any key to exit > pause>NUL > exit
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.