File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes installservice script for windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "installservice script for windows" Watch "installservice script for windows" New topic

installservice script for windows

anil policharla

Joined: Mar 25, 2009
Posts: 9
how to write installservice.cmd script and how to install service for windows
Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

By consulting the WL documentation ?

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Andy Kay

Joined: Oct 26, 2009
Posts: 29

See if the below link helps.

anil policharla

Joined: Mar 25, 2009
Posts: 9
iam asking this script how to modify it iam getting error

@rem *************************************************************************
@rem This script is used to install WebLogic Server as a Windows Service.
@rem To create your own start script for your domain, simply set the
@rem SERVER_NAME variable to your server name then call this script from your
@rem domain directory.
@rem This script sets the following variables before installing
@rem WebLogic Server as a Windows Service:
@rem WL_HOME - The root directory of your WebLogic installation
@rem JAVA_HOME - Location of the version of Java used to start WebLogic
@rem Server. This variable must point to the root directory of a
@rem JDK installation and will be set for you by the installer.
@rem See the WebLogic platform support page
@rem ( for an up-to-date list of
@rem supported JVMs on Windows NT.
@rem PATH - Adds the JDK and WebLogic directories to the system path.
@rem CLASSPATH - Adds the JDK and WebLogic jars to the classpath.
@rem Other variables that installSvc takes are:
@rem WLS_USER - admin username for server startup
@rem WLS_PW - cleartext password for server startup
@rem ADMIN_URL - if this variable is set, the server started will be a
@rem managed server, and will look to the url specified (i.e.
@rem http://localhost:7001) as the admin server.
@rem PRODUCTION_MODE - set to true for production mode servers, false for
@rem development mode
@rem JAVA_OPTIONS - Java command-line options for running the server. (These
@rem will be tagged on to the end of the JAVA_VM and MEM_ARGS)
@rem JAVA_VM - The java arg specifying the VM to run. (i.e. -server,
@rem -client, etc.)
@rem MEM_ARGS - The variable to override the standard memory arguments
@rem passed to java
@rem jDriver for Oracle users: This script assumes that native libraries
@rem required for jDriver for Oracle have been installed in the proper
@rem location and that your system PATH variable has been set appropriately.
@rem For additional information, refer to the WebLogic Server Administration
@rem Guide (
@rem *************************************************************************

@echo off

set WLS_USER=weblogic
wet WLS_PW=weblogic
set WL_HOME=C:\bea1\weblogic91

SET JAVA_HOME=C:\bea1\jdk150_04

set ADMIN_URL=http://adminserver:7501
set DOMAIN_NAME=testing
set SERVER_NAME=testing

set USERDOMAIN_HOME=c:\bea1\user_projects\domains\testing

call "%WL_HOME%\common\bin\commEnv.cmd"

@rem Check that the WebLogic classes are where we expect them to be
if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava
echo The WebLogic Server wasn't found in directory %WL_HOME%\server.
echo Please edit your script so that the WL_HOME variable points
echo to the WebLogic installation directory.
goto finish

@rem Check that java is where we expect it to be
if exist "%JAVA_HOME%\bin\java.exe" goto runWebLogic
echo The JDK wasn't found in directory %JAVA_HOME%.
echo Please edit your script so that the JAVA_HOME variable
echo points to the location of your JDK.
goto finish


if not "%JAVA_VM%" == "" goto noResetJavaVM
if "%JAVA_VENDOR%" == "BEA" set JAVA_VM=-jrocket
if "%JAVA_VENDOR%" == "HP" set JAVA_VM=-server
if "%JAVA_VENDOR%" == "Sun" set JAVA_VM=-server

if not "%MEM_ARGS%" == "" goto noResetMemArgs
set MEM_ARGS=-Xms32m -Xmx200m


@echo on


@echo ***************************************************
@echo * To start WebLogic Server, use the password *
@echo * assigned to the system user. The system *
@echo * username and password must also be used to *
@echo * access the WebLogic Server console from a web *
@echo * browser. *
@echo ***************************************************

rem *** Set Command Line for service to execute within created JVM

@echo off

if "%ADMIN_URL%" == "" goto runAdmin
@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME%\"%ADMIN_URL%\" -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
goto finish

@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"

rem *** Install the service
"%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc %DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -extrapath:"%WL_HOME%\server\bin;%JAVA_HOME%\bin" -password:"%WLS_PW%" -cmdline:%CMDLINE%


Now, i did not copy the beasvc.exe from v8.1, just the installSvc.cmd.I executed installSvc.cmd in command-prompt, and i got this error ( the end part of it ):

C:\bea1\weblogic91\server\bin>"C:\bea1\WEBLOG~1\server\bin\beasvc" -install -svc
name:"beasvc testing_testing" -javahome:"C:\bea1\jdk150_04" -execdir:"c:\bea1\us
er_projects\domains\testing " -extrapath:"C:\bea1\WEBLOG~1\server\bin;C:\bea1\jd
k150_04\bin" -password:"" -cmdline:"-server -Xms32m -Xmx200m -XX:MaxPermSize=128
m -XX:+UseSpinning -classpath \"C:\bea1\patch_weblogic910\profiles\default\sys_
a1\WEBLOG~1\server\lib\webservices.jar;\" -Dweblogic.Name=testing
\" -Dweblogic.ProductionModeEnabled=true\"C:\bea1\WEBLO
G~1\server\lib\weblogic.policy\" weblogic.Server"
CreateService failed - The specified service already exists. (0x431)


Jan Cumps

Joined: Dec 20, 2006
Posts: 2562

Yes. What does this error mean? (look into the services in the control panel to see if something like "beasvc testing_testing" shows up).

Setting Up a WebLogic Server Instance as a Windows Service

OCUP UML fundamental and ITIL foundation
I agree. Here's the link:
subject: installservice script for windows
It's not a secret anymore!