If folder exists "$localPath" GoTo Folder_UpdateReferencesAndCheckIn
msgbox -value "Select a vault folder, not a file, to update references recursively." -icon "Information"
GoTo End_UpdateReferencesAndCheckIn
Folder_UpdateReferencesAndCheckIn:
cd -directory "$localPath"
checkout -search "Name=%;FolderID=$folderID;FindFiles=true;FindFolders=false;Locked=false;Recursive=true"
updatereferences -search "Name=%;FolderID=$folderID;FindFiles=true;FindFolders=false;Locked=true;LockedBy=$userName;LockedOnComputer=$computerName;Recursive=true" -directory "$localPath" -scope UpdateAllReferences -csv "$tempFolder\PDMShell-reference-update-$folderID-$GUID.csv"
checkin -search "Name=%;FolderID=$folderID;FindFiles=true;FindFolders=false;Locked=true;LockedBy=$userName;LockedOnComputer=$computerName;Recursive=true" -comment "References updated by PDMShell"
End_UpdateReferencesAndCheckIn:
