Weblogic 9.2和10.3可通用,只需修改参照如下配置即可:
SET BEA_HOME=F:ea
SET JRE_HOME=%BEA_HOME%jdk150_04in
SET LIB_HOME=%BEA_HOME%weblogic92serverlib
rem SET BEA_HOME=D:ea
rem SET JRE_HOME=%BEA_HOME%jdk160_11in
rem SET LIB_HOME=%BEA_HOME%wlserver_10.3serverlib
SET DOMAIN_HOME=%BEA_HOME%user_projectsdomainsase_domain
SET SECURITY_HOME=%DOMAIN_HOME%security
SET SERVERS_SECURITY_HOME=%DOMAIN_HOME%serversAdminServersecurity
SET USERNAME=weblogic
SET PASSWROD=weblogicbwhk
SET EDIT_TOOL="C:Program FilesNotepad++ otepad++.exe"
@ECHO OFF
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set ldtstr=%ldt:~0,4%_%ldt:~4,2%_%ldt:~6,2%_%ldt:~8,2%_%ldt:~10,2%_%ldt:~12,2%_%ldt:~15,3%
TASKKILL /F /IM %JRE_HOME%java.exe
CD %DOMAIN_HOME%in
CALL %DOMAIN_HOME%insetDomainEnv.cmd
COPY %SECURITY_HOME%DefaultAuthenticatorInit.ldift %SECURITY_HOME%DefaultAuthenticatorInit.ldift.%ldtstr%.bak
CD %SECURITY_HOME%
%JRE_HOME%java.exe -cp %LIB_HOME%weblogic.jar weblogic.security.utils.AdminAccount %USERNAME% %PASSWROD% .
REN %DOMAIN_HOME%serversAdminServerdata data.%ldtstr%.bak
ECHO OFF
ECHO 请修改即将打开的boot.properties文件中的用户名与密码。示例如下:
ECHO username=%USERNAME%
ECHO password=%PASSWROD%
ECHO ON
PAUSE
COPY %SERVERS_SECURITY_HOME%oot.properties %SERVERS_SECURITY_HOME%oot.properties.%ldtstr%.bak
%EDIT_TOOL% %SERVERS_SECURITY_HOME%oot.properties