"Summary: Modal ads, ads that reorganize content, and autoplaying video ads were among the most disliked. Ads that are annoying on desktop become intolerable on mobile."
TechnoInfo is a collection place for news about technology; specifically cool new things, and how technology and man influence each other.
June 24, 2017
June 23, 2017
Batch file to check for new/changed/deleted files in folders
I created this batch file to check
for new or changed files in a folder including subfolders.
- It uses Robocopy to build a local representation of the files and directory structure, but all files are 0-byte files for speed and storage efficiency
- It shows results on the screen, and adds everything to a log file for later perusal.
- This example contains 1 block of the checker code, to check one folder, but you may add more as you wish (my real one monitors 3 folders).
- I use Task Scheduler to run it every day; that could be less or more often as you wish.
- I use a shortcut to it, with some changes made in Properties, to make it look better:
- Font tab:
Size=16
Font=Consolas - Layout tab:
Width (both)=196 (this is edge to edge on my display)
Screen buffer height=3000 (so I can scroll back if many results)
Window size Height = 40
Window position= zero and zero, with "Let system position window" unchecked - The code is below, and is somewhat ::commented for your ease of
understanding; you can place all this into a text file, change the things
that need to be changed, rename the file to anything.bat, and there's your
batch file. Make the shortcut to it if you want and style it in the way
mentioned above, and use that shortcut to run the file (either manually,
or scheduled via Task Scheduler).
::Written by Jeff Gillman
@echo off
MODE CON COLS=172 LINES=50
color 3e
::define the log file
set log=C:\Users\[username]\filechecker\checker.log
::write a date/timestamp to the log file
date /t >>%log%
time /t >>%log%
::text that will be displayed at the beginning
echo.
echo FileChecker: checks for new/udpated/deleted files in specific folders
echo New = new file
echo Newer = file updated since previous scan
echo *EXTRA = file deleted at source
echo.
echo.
::block 1 (first folder)
set source=c:\users\[username]\desktop
set target=c:\users\[username]\filechecker\desktop
echo.
echo ........... Checking for new files in %source%
robocopy %source% %target% /s /e /create /njh /njs /l /ndl /ns /purge | find /v " Changed"
robocopy %source% %target% /s /e /create /njh /njs /ndl /ns /purge | find /v " Changed" >>%log%
::color change to help user detect progress
color 4b
set source=\\[server1]\[folder1]
set target=c:\users\[username]\filechecker\[folder1]
echo.
echo ........... Checking for new files in %source%
robocopy %source% %target% /s /e /create /njh /njs /l /ndl /ns /purge | find /v " Changed"
robocopy %source% %target% /s /e /create /njh /njs /ndl /ns /purge | find /v " Changed" >>%log%
color e5
::block 2 (second folder)
set source=\\[server2]\[folder2]
set target=c:\users\[username]\filechecker\[folder2]
echo.
echo ........... Checking for new files in %source%
robocopy %source% %target% /s /e /create /njh /njs /l /ndl /ns /purge | find /v " Changed"
robocopy %source% %target% /s /e /create /njh /njs /ndl /ns /purge | find /v " Changed" >>%log%
color f9
::block 3 (third folder)
set source=\\[server2]\\[folder3][folder3]
echo.
echo ........... Checking for new files in %source%
robocopy %source% %target% /s /e /create /njh /njs /l /ndl /ns /purge | find /v " Changed"
robocopy %source% %target% /s /e /create /njh /njs /ndl /ns /purge | find /v " Changed" >>%log%
::final display of info
echo.
color 4f
echo \
echo \\
echo \\\ The above is also logged to %log%
::reset variables to null
set log=
set source=
set target=
echo.
echo Press any key to exit.
::wait for keypress, hide text because we're using custom text above
pause>nul
exit
June 04, 2017
Subscribe to:
Posts (Atom)