- Oct
- 364
- 17
The code below creates a list of the junctions in subfolders of the specified folders. The reason for doing that is in the beginning comment.
I'll post sample output separately to point out the problem.
I'll post sample output separately to point out the problem.
Code:
:: Junction_Check.btm
::
:: By Joseph "Rick" Reinckens II
:: Nov 2018 No copyright claimed
:: Uses TCC v. 18 but should work on others
::
:: Create a list of junctions showing the folders they are in.
::
:: This is because I have a large number of junctions from
:: different versions of an image editing program that point to
:: a combination set containing scripts, brushes, etc., and
:: something happened that changed all the junction targets from
:: S:\Program_Data\.. to C:\Program_Data\.. and the programs didn't
:: give errors indicating the change.
::
:: I can run this periodically to check that that hasn't happened again.
:: ********** WARNING **********
:: This CAN run in the root folder for the various drives. But full
:: partitions have a LOT of junctions so it takes awhile. If you
:: run it on one don't assume it has hung up.
@echo off
Set outfile="S:\Program_Data\All_Junctions.txt"
:: Add a header
Echo.>>%outfile
Echo.>>%outfile
Echo ========================>>%outfile
Echo RAN CHECK %_isodate>>%outfile
:: ************************
:: Folders to check
:: ************************
GOSUB CJIS "C:\Program Files\Corel"
GOSUB CJIS "D:\Documents-Rick"
:: AUTOMATICALLY OPEN THE FILE
%outfile
QUIT
:: Check Junctions In Subfolders
:CJIS [dir_to_chk]
Echo.>>%outfile
Echo.>>%outfile
Echo ========>>%outfile
Echo FOLDER: %dir_to_chk>>%outfile
Echo.>>%outfile
dir /a:j /s /h /m %dir_to_chk >>%outfile
RETURN
Last edited: