|
本批处理的适用环境:
CATIA:V5R10~R24(V5-6R2014)32bit & 64bit
OS : Xp/2k3/win7 32bit & 64bit
哪些情况下你可能需要本批处理程序:
1. 重装操作系统后,不想再次安装CATIA时。(其中R21及更新版本仍然需要安装DSLS,生成许可证证。而R20及更老版本则不需要)
2. 安装了多个CATIA版本,自己不会配置用户环境,多次切换版本导致配置经常被重置。
3. 给绿色版CATIA安装sp补丁时,总被提示“在安装 Service Pack 前需要安装代码级别 Bxx。”
4. 有时使用中文版CATIA,有时使用英文版CATIA,但自己不会配置。
由本批处理所生成的配置文件默认添加了“启动不新建product”、“不显示星空背景图片”等选项,加速CATIA启动,配合SSD时,即使冷启动也可秒启。- @ECHO off
- color 0A
- cls
- ECHO =======================================================================
- ECHO.
- ECHO www.taotao600.com
- ECHO.
- ECHO 2014.04.21 first version of batch released compatible xp ^& Win2K3
- ECHO 2014.04.23 compatible with win7 UAC privilege limitation
- ECHO 2014.04.24 compatible 64bit CATIA program
- ECHO Fix missing CATKnowledgePath parametric of env file
- ECHO =======================================================================
- ECHO waiting......
- if exist "%~dp0intel_a" set InstallDir=%~dp0intel_a
- if exist "%~dp0win_b64" set InstallDir=%~dp0win_b64
- %InstallDir%\code\bin\cnext /regserver
- set ExistFolds=0
- setlocal enabledelayedexpansion
- if exist "%~dp0ENV_tyc600" (
- for /f "delims=" %%i in ('dir /ad /b "%~dp0ENV_tyc600" ') do (
- set /a a+=1
- )
- set ExistFolds=!a!
- )
- setlocal disabledelayedexpansion
- md "%~dp0ENV_tyc600\Config_%ExistFolds%\CATSettings"
- if exist "%Tmp%\tyc600.vbs" del /f/q "%Tmp%\tyc600.vbs"
- >>%Tmp%\tyc600.vbs echo For Each objOS in GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
- >>%Tmp%\tyc600.vbs echo If InStr(objOS.Caption,"XP") = 0 And InStr(objOS.Caption,"2003") = 0 Then
- >>%Tmp%\tyc600.vbs echo If WScript.Arguments.length = 0 Then
- >>%Tmp%\tyc600.vbs echo Dim objShell
- >>%Tmp%\tyc600.vbs echo Set objShell = CreateObject("Shell.Application")
- >>%Tmp%\tyc600.vbs echo objShell.ShellExecute "wscript.exe", Chr(34) ^& WScript.ScriptFullName ^& Chr(34) ^& " uac", "", "runas", 1
- >>%Tmp%\tyc600.vbs echo End If
- >>%Tmp%\tyc600.vbs echo End If
- >>%Tmp%\tyc600.vbs echo Next
- >>%Tmp%\tyc600.vbs echo Set fso = WScript.CreateObject("Scripting.FileSystemObject")
- >>%Tmp%\tyc600.vbs echo CATVersion=Mid(fso.GetFileVersion("%InstallDir%\code\bin\CNEXT.exe"),3,2)
- >>%Tmp%\tyc600.vbs echo CATR="CATIA_R" ^& CATVersion ^& "_%ExistFolds%"
- >>%Tmp%\tyc600.vbs echo Set WshShell = WScript.CreateObject("WScript.Shell")
- >>%Tmp%\tyc600.vbs echo set oShellLink = WshShell.CreateShortcut("%~dp0" ^& CATR ^& ".lnk")
- >>%Tmp%\tyc600.vbs echo oShellLink.TargetPath ="""%InstallDir%\code\bin\CATSTART.exe"""
- >>%Tmp%\tyc600.vbs echo oShellLink.Arguments =" -run " ^& Chr(34) ^& "CNEXT.exe" ^& Chr(34) ^& " -env " ^& CATR ^& " -direnv " ^& Chr(34) ^& "%~dp0ENV_tyc600\Config_%ExistFolds%" ^& Chr(34) ^& " -nowindow"
- >>%Tmp%\tyc600.vbs echo oShellLink.WindowStyle = 1
- >>%Tmp%\tyc600.vbs echo oShellLink.IconLocation = "%InstallDir%\code\bin\CNEXT.exe,0"
- >>%Tmp%\tyc600.vbs echo oShellLink.Description = "CATIA shortcut created by tyc600"
- >>%Tmp%\tyc600.vbs echo oShellLink.Save
- >>%Tmp%\tyc600.vbs echo WScript.Echo CATVersion
- for /f "delims=" %%i in ('cscript //nologo "%Tmp%\tyc600.vbs" ') do set "CATVersion=%%i"
- Set CATVersion=%CATVersion:~,2%
- REG ADD "HKLM\SOFTWARE\Dassault Systemes\B%CATVersion%\0" /V "DEST_FOLDER" /T REG_EXPAND_SZ /D "%~dp0" /f
- REG ADD "HKLM\SOFTWARE\Dassault Systemes\B%CATVersion%\0" /V "DEST_FOLDER_OSDS" /T REG_EXPAND_SZ /D "%InstallDir%" /f
- REG ADD "HKLM\SOFTWARE\Dassault Systemes\B%CATVersion%\0" /V "IDENT" /T REG_EXPAND_SZ /D "tyc600" /f
- REG ADD "HKLM\SOFTWARE\Dassault Systemes\B%CATVersion%\0" /V "OSNAME" /T REG_EXPAND_SZ /D "INTEL" /f
- Set ENVConfigName="%~dp0ENV_tyc600\Config_%ExistFolds%\CATIA_R%CATVersion%_%ExistFolds%.txt"
- >>%ENVConfigName% echo !----------------------------------------------------------
- >>%ENVConfigName% echo ! DASSAULT SYSTEMES - V5 ENVIRONMENT FILE
- >>%ENVConfigName% echo !----------------------------------------------------------
- >>%ENVConfigName% echo ! MODE : Global
- >>%ENVConfigName% echo ! TYPE : CATIA
- >>%ENVConfigName% echo ! TMSTMP : created by tyc600
- >>%ENVConfigName% echo !----------------------------------------------------------
- >>%ENVConfigName% echo CATInstallPath=%InstallDir%
- >>%ENVConfigName% echo CATDLLPath=%InstallDir%\code\bin
- >>%ENVConfigName% echo CATICPath=%InstallDir%\code\productIC
- >>%ENVConfigName% echo CATCommandPath=%InstallDir%\code\command
- >>%ENVConfigName% echo CATDictionaryPath=%InstallDir%\code\dictionary
- >>%ENVConfigName% echo CATDocView=%InstallDir%\doc
- >>%ENVConfigName% echo CATReffilesPath=%InstallDir%\reffiles
- >>%ENVConfigName% echo CATFontPath=%InstallDir%\resources\fonts
- >>%ENVConfigName% echo CATGalaxyPath=%InstallDir%\resources\galaxy
- >>%ENVConfigName% echo CATGraphicPath=%InstallDir%\resources\graphic;%InstallDir%\resources\graphic\icons;%InstallDir%\resources\graphic\figures;%InstallDir%\resources\graphic\splashscreens;%InstallDir%\resources\graphic\symbols;%InstallDir%\resources\graphic\textures
- >>%ENVConfigName% echo CATMsgCatalogPath=%InstallDir%\resources\msgcatalog
- >>%ENVConfigName% echo CATFeatureCatalogPath=%InstallDir%\resources\featurecatalog
- >>%ENVConfigName% echo CATDefaultCollectionStandard=%InstallDir%\resources\standard
- >>%ENVConfigName% echo CATKnowledgePath=%InstallDir%\resources\knowledge
- >>%ENVConfigName% echo CATStartupPath=%InstallDir%\startup
- >>%ENVConfigName% echo CATW3ResourcesPath=%InstallDir%\docs
- >>%ENVConfigName% echo CATReferenceSettingPath=
- >>%ENVConfigName% echo CATUserSettingPath=%~dp0ENV_tyc600\Config_%ExistFolds%\CATSettings
- >>%ENVConfigName% echo CATCollectionStandard=
- >>%ENVConfigName% echo CATTemp=CSIDL_LOCAL_APPDATA\DassaultSystemes\CATTemp
- >>%ENVConfigName% echo CATMetasearchPath=DSKEY_TMPDIR
- >>%ENVConfigName% echo CATW3PublishPath=DSKEY_TMPDIR
- >>%ENVConfigName% echo CATSharedWorkbookPath=DSKEY_TMPDIR
- >>%ENVConfigName% echo CATErrorLog=CSIDL_LOCAL_APPDATA\DassaultSystemes\CATTemp\error.log
- >>%ENVConfigName% echo CATReport=CSIDL_LOCAL_APPDATA\DassaultSystemes\CATReport
- >>%ENVConfigName% echo CATDisciplinePath=
- >>%ENVConfigName% echo USER_HOME=CSIDL_PERSONAL
- >>%ENVConfigName% echo JAVA_HOME=%JAVA_HOME%
- >>%ENVConfigName% echo CLASSPATH_JDBC=
- >>%ENVConfigName% echo CLASSPATH=%CLASSPATH_JDBC%;%CLASSPATH%
- >>%ENVConfigName% echo PATH=%InstallDir%\code\bin;%InstallDir%\code\command;%%JAVA_HOME%%\bin;%%PATH%%
- >>%ENVConfigName% echo CATNoStartDocument=no
- >>%ENVConfigName% echo CNEXTSPLASHSCREEN=no
- >>%ENVConfigName% echo CNEXTBACKGROUND=no
- >>%ENVConfigName% echo L_WILSON_LAN=1
- >>%ENVConfigName% echo CGM_ROLLINGOFFSET=1
- >>%ENVConfigName% echo TAILLE_MEMOIRE_CHOISIE=1
- if exist "%Tmp%\tyc600.vbs" del /f/q "%Tmp%\tyc600.vbs"
复制代码 使用步骤:
1. 复制上述代码,并保存为bat批处理。
2. 然后将批处理如下图所示放在CATIA的安装目录里,双击运行完毕后,即使绿色版也可开始安装Service Pack了,并且在当前目录下自动生成用户配置和CATIA快捷方式。
32bit的catia 请将批处理放在如下图所示的目录里:
64bit的catia 请将批处理放在如下图所示的目录里:
双击第一次运行批处理后,将产生一个ENV_tyc600的文件夹并在其下生成配置1文件夹Config_0,和一个CATIA快捷方式,如下图所示:
双击第二次运行批处理后,将产生在ENV_tyc600的文件夹内生成配置2文件夹Config_1,和另一个CATIA快捷方式。如下图所示:
以此类推,还可以生成配置3、配置4……。建议先启动第一个快捷方式进行配置(比如设定语言为中文,快捷键,工具条布局等),之后将第一个快捷方式对应的CATSettings文件夹下的所有文件覆盖到第二个快捷方式对应的CATSettings文件夹内。再启动第二个快捷方式,此时就相当于在上次一配置的基础上进行再配置。这样可以保留第一次配置的相同部分(如快捷键,工具条等),之后进行不同的设置(比如将语言修改为英文)。这样就可以根据需要启动不同的快捷方式,从而避免来回切重启CATIA。
注意:之后,CATIA的快捷方式可自由改名,但是保存配置的ENV_tyc600文件夹以及用户配置文件CATIA_R21_0.txt请勿改名,否则无法保证快捷方式的正常运行)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|