By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Confirm junctions haven't changed

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.

:: 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 RAN CHECK %_isodate>>%outfile

:: ************************
:: Folders to check
:: ************************
    GOSUB CJIS "C:\Program Files\Corel"
    GOSUB CJIS "D:\Documents-Rick"


:: Check Junctions In Subfolders
:CJIS [dir_to_chk]

    Echo      ========>>%outfile
    Echo FOLDER: %dir_to_chk>>%outfile

    dir /a:j /s /h /m %dir_to_chk >>%outfile
Last edited:
Example output is below. Something changed all of these from S:\ to C:\. I changed all of them back except the one in red that I found using the above program.


RAN CHECK 2018-11-25

FOLDER: "C:\Program Files\Corel"

Volume in drive C is Rick-Win10x64_C Serial number is a8f2:c18d

Directory of C:\Program Files\Corel\Corel PaintShop Pro 2018 (64-bit)\*
11/23/2018 22:27 <JUNCTION> PlugIns [S:\Program_Data\Corel\PaintShop Pro\PlugIns]

Directory of C:\Program Files\Corel\Corel PaintShop Pro 2019 (64-bit)\*
11/23/2018 22:29 <JUNCTION> PlugIns [S:\Program_Data\Corel\PaintShop Pro\PlugIns]

Directory of C:\Program Files\Corel\Corel PaintShop Pro X9 (64-bit)\*
11/23/2018 22:30 <JUNCTION> PlugIns [S:\Program_Data\Corel\PaintShop Pro\PlugIns]

Directory of C:\Program Files\Corel\Corel VideoStudio X9\ScoreFitter\*
12/25/2016 21:04 <JUNCTION> Hypersonic Content [C:\Program_Data\Corel\VideoStudio\X9\Hypersonic Content]

FOLDER: "D:\Documents-Rick"

Volume in drive D is Sea_D Serial number is 36ea:698d

Directory of D:\Documents-Rick\Corel PaintShop Pro\*

11/24/2018 0:49 <JUNCTION> 18.0 [S:\Program_Data\Corel\PaintShop Pro\File-Types]
11/24/2018 0:49 <JUNCTION> 19.0 [S:\Program_Data\Corel\PaintShop Pro\File-Types]
11/24/2018 0:49 <JUNCTION> 2018 [S:\Program_Data\Corel\PaintShop Pro\File-Types]
11/24/2018 0:49 <JUNCTION> 2019 [S:\Program_Data\Corel\PaintShop Pro\File-Types]
To give an example of why this is helpful, the four PSP versions total 75 junctions. I use a different TCC program to create junctions for each new version installation (which is annually.)