Update 2020 Revit Cache file (BAT file)

 @echo off

@echo 2021-06-02v01.00 :: Hard-coded revit ini file to the 'builder' locaton for the Revit ini (cached locaiton) :: This script should move the esisting one to a dated RECORD\yyyy-mm-dd folder and copy the :: NNEW Revit ini file in it place. set RevitINI="\\ktgyir-a-cad\BIM\_Deployments\Autodesk\REVIT\2020\Revit-KTGY.ini" @echo - Checks If file/folder exists for 2020 Ktgy-Revit.ini if that doesn't exist exit :::Visual file check will show 0 files if doesn't exist: :::dir "%revitINI%" :::pause ::If the Revit ini file doesn't exist - exit out - good if source cannot be found if not exist %RevitINI% goto :ExitNoFile @echo. @echo FOUND: %RevitINI% @echo Proceeding... @echo. ::Working Revit INI Backup folder - Tpical of revit (Version # varies) ::Make the record folder for the Revit.ini cached version- set RecordFP=c:\ProgramData\Autodesk\RVT 2020\UserDataCache\RECORD if not exist "%RecordFP%" mkdir "%RecordFP%" ::Set the target bakup folder based on the date and push response to NUL for quiet if exists set RecordFP=c:\ProgramData\Autodesk\RVT 2020\UserDataCache\RECORD\%date:/=% ::Make the dated folder if not exists @echo "%RecordFP%" if not exist "%RecordFP%" mkdir "%RecordFP%" ::MOVE The old INI file to the record copy folder @echo move... Move /y "c:\ProgramData\Autodesk\RVT 2020\UserDataCache\Revit.ini" "%RecordFP%\Revit.ini" ::Uncomment nect line to open the folder by default ::explorer "%RecordFP%\" ::Copy from corp update to the cache location(s) @echo copy... copy %RevitINI% "c:\ProgramData\Autodesk\RVT 2020\UserDataCache\Revit.ini" @echo User data cache update complete. @echo.............................. @echo Success updating Cached file. @echo. @echo Moving old REvit INI to RECORD folder ::::::::::::::::::::::::::::::::::::::::::::::::::::::::USER INI FILE: ::C:\Users\ron.allen\AppData\Roaming\Autodesk\Revit\Autodesk Revit 2020\Revit.ini :::NOTE: ::This may create an issue as the %userprofile% needs to be run as the user not PDQSVC ::: set RevitINI=%UserProfile%\AppData\Roaming\Autodesk\Revit\Autodesk Revit 2020\Revit.ini ::Check the User INI file exists- if not exit before we do anything. if not exist %RevitINI% goto :ExitNoFile ::Setup for record folder - NOTE one folder "up" as reset wipes entire folder! set RecordFPusr=%UserProfile%\AppData\Roaming\Autodesk\Revit\RECORD ::Make the Record folder if not exist "%RecordFPusr%" mkdir "%RecordFPusr%" ::Setup for record folder - NOTE one folder "up" as REVIT's reset wipes entire folder! set RecordFPusr=%UserProfile%\AppData\Roaming\Autodesk\Revit\RECORD\R2020 ::Make the Record folder if not exist "%RecordFPusr%" mkdir "%RecordFPusr%" ::Setup the dated folder set RecordFPusr=%UserProfile%\AppData\Roaming\Autodesk\Revit\RECORD\R2020\%date:/=% ::Make the dated folder if not exist "%RecordFPusr%" mkdir "%RecordFPusr%" ::Move the Revit ini Move "%RevitINI%" "%RecordFPusr%\Revit.INI" ::explorer %RecordFPusr% ::Skip error section and cleanup if needed Goto Cleanup :ExitNoFile @echo FAILED::: Revit INI not found - please make sure the @echo %RevitINI% @echo exists and you are connected to VPN or the server for source file copies. :Cleanup ::net use A: /delete /Y pause

Comments

Popular posts from this blog

Revit area plans adding new types and references (Gross and rentable)

Powerpoint countdown and current time in slides VBA

Revit Python in Visual Studio Revit Stubs 2022 for Python Revit Intellisense