Hello,
I have fond this interesting program and before I install it I want to make sure can it solve my problem. I want to achieve this:
1) I create a directory list (txt report) for a directory. The list contains all the files in the specified directory (including time stamps and all the other file info)
2) after some time (e.g. a month) when the contents of the directory changes I want to compare the actual content of the folder (changed after directory restoration from a DVD-R) with the previously generated directory list report (created before restoration from the DVD-R)
3) all the files in the directory which are NOT in the previously created directory list report have to be DELETED by the program
Is this possible?
If not directly is it possible to create a script? Does the program support scripting?
thank you
Delete files from a directory by reading directory report?
Re: Delete files from a directory by reading directory repor
I have meanwhile solved the problem with two script files (windows batch files) one with 1 line of code and the other with 4 lines of code!
Here they are:
------batch file 1----------
dir "C:<directory1>" >"C:<directory2>\FileList.txt"
--end of batch file 1-------
------batch file 2----------
@echo off
cd "C:<directory1>"
for %%a in (*.*) do (findstr /C:"%%a" "C:<directory2>\FileList.txt" >NUL
if errorlevel 1 del "%%a")
--end of batch file 2-------
<directory1> is the directory which contains files to be checked against the file list report
<directory2> is the directory where the file list report (txt file named "FileList.txt" is placed
Solution:
a) First I click on bat file 1
b) After some time (e.g. after folder initialization from DVD-R) I click on the second bat file which deletes all the files which are not in the file list report created by the first bat file
I am posting this here since there might be other people who have a similar problem so there is a simple solution.
Here they are:
------batch file 1----------
dir "C:<directory1>" >"C:<directory2>\FileList.txt"
--end of batch file 1-------
------batch file 2----------
@echo off
cd "C:<directory1>"
for %%a in (*.*) do (findstr /C:"%%a" "C:<directory2>\FileList.txt" >NUL
if errorlevel 1 del "%%a")
--end of batch file 2-------
<directory1> is the directory which contains files to be checked against the file list report
<directory2> is the directory where the file list report (txt file named "FileList.txt" is placed
Solution:
a) First I click on bat file 1
b) After some time (e.g. after folder initialization from DVD-R) I click on the second bat file which deletes all the files which are not in the file list report created by the first bat file
I am posting this here since there might be other people who have a similar problem so there is a simple solution.
Who is online
Users browsing this forum: No registered users and 2 guests