Manual startup/shutdown of windows services using command prompt or .bat
Hi,
I know that we could shutdown and start of SAP in windows using the following commands in a .bat file.
SAP:
stopsap name=<SID> nr=<SYSNR> SAPDIAHOST=<host>
startsap name=<SID> nr=<SYSNR> SAPDIAHOST=<host>
OS Collector:
saposcol -k
Oracle Listener:
lsnrctl stop / start
How about the following services:
SAPDEV_00
OracleOraHome92Agent
OracleServiceDEV
How can I stop and start of these services in a batch file?
thanks,
kbas
Try,
net stop <service name>
net start <service name>
Message was edited by:
Bidwan Baruah
Similar Messages
-
Discover OS language and architecture of Windows 7 using command prompt
The problem: in a bat file a need make different think based on language an os architecture of windows 7 (are different setup program to be running).
Something like this:
IF OSLanguage = 1033 AND OSArchitecture == 32-bit DO
IF OSLanguage == 1033 AND OSArchitecture == 64-bit DO
and so on....
I have tried with this script:
FOR /f "tokens=1,2 delims==" %%A IN ('"wmic os get OSArchitecture,OSLanguage /format:list"') DO (
IF /I %%A == "OSArchitecture" SET MyArch = %%B
IF /I %%A EQU "OSLanguage" SET MyLCID = %%B
ECHO %MyArch%
ECHO %MyLCID%
Result:
There are many blank row in the result of the wmic command (this is curiosity not problem)
%%A and %%B are well compiled (if I use ECHO %%A and ECHO %%B inside the do the value are displayed)
%MyArch% and %MyLCID% are empty
Thanks for any idea
LSo
LSo Lorenzo Soncini Trento TN - ItalyI have resolved the first issue. Now with the script:
for /f "tokens=2 delims==" %%A in ('wmic path win32_OperatingSystem get OSLanguage /Value') do set LSOLCID=%%A
for /f "tokens=2 delims==" %%A in ('wmic path win32_OperatingSystem get OSArchitecture /Value') do set LSOARCH=%%A
ECHO Language: %LSOLCID% - Architecture: %LSOARCH%
I have the right answer and the correct value in the 2 variable.
Now if I use this function:
IF /I {%LSOARCH%} == {32 bit} goto :32BIT
IF /I {%LSOARCH%} == {64 bit} goto :64BIT
I receive the error "bit} is unexpected." (In Italian is "bit} non atteso.")
If I use
IF /I %LSOARCH% == 32 bit goto :32BIT
IF /I %LSOARCH% == 64 bit goto :64BIT
the error is "bit is unexpected." (In Italian is "bit non atteso.")
My hipotesys is some character wrong inside the %LSOARCH%. But if I use something like this:
SET _prefix = %LSOARCH:0,2%
and made the if
IF /I %_prefix% == 32 GOTO :32BIT
I receive the same error (ECHO %_prefix% tell me correctly the value of 32)
I use Windows 7 SP1 Professional 32 bit Italian
LSo
LSo Lorenzo Soncini Trento TN - Italy -
IOP startup and shutdown as windows services
Hi,
Is there a way can we have IOP startup and shutdown as windows services instead of running the bat files?
Thanks,
Hari DevarapalliYes. You can install IOP as NT service and start/stop it.
Please refer to "Installing Integrated Operational Planning as an NT Service" in the IOP install guide. -
How to use addKeyListener in a program running using command prompt
Does anyone have any idea how to add the addKeyListener to a program running using command prompt.
Let me explain how the program run.
The program is start and accept call from other program. But from time to time, I need to issue some command by pressing the keyboard, let say, ESC is closed the program, F1 is showing the stated. F2.... (This is all need to run in the command prompt windows)
My problem is this program does not have any gui interface, so how can it be added?
i do it this way
public void key(){
addKeyListener(this);
But it have compile error.
mainServerImpl.java:87: cannot resolve symbol
symbol : method addKeyListener (mainServerImpl)
location: class mainServerImpl
addKeyListener(this);
I did implement KeyListener. But just don't know how to solve this error.
can anyone tell me how to solve it or point me a source that can help.
Thank in advance!
Regards,
Tai TanWrite your own Thread, to do this:
public class KeyThread extends Thread {
public void run {
while(true) {
int i = System.in.read();
if(i == 123) {
break; // to stop the thread
// in your main:
Thread keyThread = new KeyThread();
keyThread.start(); // calls run() of the thread -
How to compile & run using command prompt
Hi all,
I have a java application consisting of 3 packages & a jar file in the following hierarchy:
-Project
-classes
-src
-package1
-package2
-package3
-file.jar
The main class exists in package2 and uses classes within file.jar
I want the steps to compile and execute the project using command prompt in windows such that the generated classes will be saved in the classes directory
Can anyone help?
Thanx in advanceHey,
If your source(*.java) files are in src folder and ur currnet directory is project
and you want all your class files to be classes folder then you can try this :
c:\project>javac -cp src\file.jar -d classes\ src\*.javaAssuming that your file.jar file is in src folder.
The above command will set the classpath to src\file.jar (-cp src\file.jar)
-d classes\ - will generate all your class files with package hierarchy if any into classes directory.
src\*.java - specifies the files to be compiled.
Hope this helps. -
Is there any way to launch Shared Services in command prompt for migration?
Hi All,
We are on 11.1.1.1.3 Is there any way to launch Shared Services in command prompt for migration purposes? The purpose is we need to automate the migration process from Dev to Prod. Currently we are exporting artifacts by using LCM in shared service by file management and then exporting that folder to prod server and then importing by using LCM. So we need to automate the whole process.
So is there any way we can launch shared services/LCM in command prompt to launch the migration for export/import artifacts?
Any suggestions will be great help.Did you see the bit in the documentation called "Creating Migration Definitions"?
See: http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_lifecycle_management/ch06s03s01.htm
Also, if you follow this link, the docs explain how to (sort of) generate the xml:
http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_lifecycle_management/ch06s03.htm
Regards,
Cameron Lackpour -
Running a Program in JDeveloper using Command Prompt
Hi,
I downoladed Oracle JDeveloper 10g. I had written a simple java class called Echo. java. I want to run the file using command prompt. My JDK has the following path:
F:\Sowmya
My java file has the following path:
F:\Sowmya\jdev\mywork\1\1\src\pkg1
So, in order to compile the file, I gave the following command:
F:\Sowmya\jdk\bin>javac F:\Sowmya\jdev\mywork\1\1\src\pkg1\Echo.java
It worked and the Echo.class file was created.
But, when I tried to run the file using the following command,
F:\Sowmya\jdk\bin>java F:\Sowmya\jdev\mywork\1\1\src\pkg1\Echo
Iam getting the following error:
Exception in thread "main" java.lang.NOClassDefFoundError: F:\Sowmya\jdev\mywork\1\1\src\pkg1\Echo
This didnt work either:
F:\Sowmya\jdk\bin>java F:\Sowmya\jdev\mywork\1\1\classes\pkg1\Echo
Iam getting the same error.
Can any one please help me regarding this.
Thank you,
Sowmya.Yes, my class contains a main. It runs if I click run in JDeveloper. But, there is no output displayed. The following is the code:
public class Echo {
public static void main (String[] args) {
for (String s: args) {
System.out.println(s);
} -
Uninstalling bulk dll's from gac folder at one time using command prompt
Hi All,
I need to unistall bulk dll's at a time from the GAC folder using command prompt ,can any one suggest how to do this.Hi,
1. Create a batch file as "Uninstall.bat".
2. Edit this file and copy the below statements in it:
gacutil.exe /uf DLL1
gacutil.exe /uf DLL2
gacutil.exe /uf DLL3
gacutil.exe /uf DLL4
gacutil.exe /uf DLL5
replace DLL1 to DLL5 with your actual DLL names, which you want to uninstall.
3. Open Visual Studio Command Prompt as Administrator.
4. Browse to the location where you have placed the above batch file.
5. Run the batch file.
Hope this will help.
HTH,
Sumit
Sumit Verma - MCTS BizTalk 2006/2010 - Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question -
Can i login to essbase console by using command prompt
Hi All,
Is thr any possiblity to login in to essbase console by using command prompt
normally we login to console and will give credentails and login as same way can we do from command prompt??
Thanks in advance
Regards,
SMHello ,
You can check the login through the Essbase command utility.
go to command prompt . type - essmsh
then you will be able to see MaxL prompt
enter the command login username password;
you can use this utility to load data , import export running calc etc...
Thanks,
KKT -
Using command prompt for help generating
Hi all!
Can I use command prompt for generating webhelp instead of
RoboHelp HTML environment?
thank youSee this recent post.
Click
here. -
Using command prompt with Java
I am trying to use command prompt within a java program and I can't figure out how to enter commands from java. I know how to start up command prompt but can someone guide me on a way to actually enter commands into the command prompt? Thanks.
The Java� Tutorial - Lesson: Basic I/O
~ -
How to run ODI scenario using command prompt
Hi expets
Please let me know if we can run ODI scenario using command prompt or any way other than operator.
Regards
JanakiramGo to <ODI_HOME>/oracledi/bin in command prompt and invoke startscen command with teh below parameters.
Edited by: Guru Sankar on Feb 28, 2011 4:19 PM -
Start SQL Server Service in Remote Server using Command Prompt with Single User Mode
Hi Folks,
I am able to STOP/START the Remote SQL Server Service using the following Command.
sc \\RemoteServerName START ServiceName
How to Start the Remote SQL Server Service using Single User Mode.
sc \\RemoteServerName START ServiceName -m
NarendranHello,
sqlservr.exe -m
or
sqlservr.exe -m -s
(for named instances)
For more information:
http://technet.microsoft.com/en-US/library/ms180965(v=SQL.105).aspx
Configure Windows Firewall or security software properly.
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
How to print pdf file in SQL Server Reporting services report using command prompt?
Is there a way to automatically print a SQL Server Reporting services report on command prompt? For eg: We can save a pdf file using rs.exe utility. I want to print a pdf using rs.exe utility. Is it possible? I don't want to install any 3rd party software.
Thanks Simon for replying to my question.
In oracle form, there is oracle command to print the report from command prompt with the help of rwrun.exe
e.g: rwrun.exe REPORT="D:\Test\REP_25\MLA.REP" DESNAME="testprinter" DESTYPE="PRINTER" P_FORMNAME="MLA.FMX" P_SPRACHE="E" P_SPRACHE_NR2="1" P_WHERE_BEDINGUNG="order by land_nr" USERID="test/test.world" PSV_NAME="PSV_DEMO" PSV_JOB_ID="PS$9583" RECURSIVE_LOAD="NO"
BATCH="YES" NONBLOCKSQL="NO" ARRAYSIZE="1" PARAMFORM="NO" ERRFILE="c:\temp\psv16.tmp"<
and to save the report we just need to change DESNAME="c:\temp\OC_100001349.pdf" DESTYPE="FILE" in above command instead of DESNAME="testprinter" DESTYPE="PRINTER".
DESNAME and DESTYPE are the input parameters of the respective report.
In SSRS, we can run the file from the command prompt and save it.
rs -i "C:\Users\pujarswa\Documents\reports\new\LoadReport.rss" -s ww2004760:80/ReportServer_MSSQL -v fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf"
-v reportPath="/TipsReport/LoadListTabular" -t -v format="PDF" -v LandNr=4 -u ap\swati -p test@# -e Exec2005
But we cannot use same command for printing as you said we need to create another script for printing files.
I have gone through the links but I dont want to use Adobe Acrobat Reader exe for printing because client it may not have Adobe Acrobat Reader on their machine.
Also I want to pass a input parameter as type="Printer" to my report which will print directly for me and same I can acheive in command prompt passing type="Printer" fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf" -
How to create a client console to connect to server in windows service using c#
my code is error
can you check the code please
client console code
partial class Program : ServiceBase
public static void Main(string[] args)
serverservice ss = new serverservice();
ss.myserver();
TcpClient tcpc = new TcpClient();
Console.WriteLine("connecting.......");
tcpc.Connect("10.128.1.116", 80);
Console.WriteLine("connected........");
Console.Write("enter msg to be transimitt");
string str = Console.ReadLine();
Stream stm = tcpc.GetStream();
ASCIIEncoding asc = new ASCIIEncoding();
byte[] ba = asc.GetBytes(str);
Console.WriteLine("transmitting..........");
stm.Write(ba, 0, ba.Length);
byte[] bb = new byte[100];
int k = stm.Read(bb, 0, 100);
for (int i = 0; i < k; i++)
Console.Write(Convert.ToChar(bb[i]));
tcpc.Close();
windows service for server code is
public partial class serverservice : ServiceBase
public serverservice()
InitializeComponent();
protected override void OnStart(string[] args)
myserver();
Thread mythread = new Thread(new ThreadStart(myserver));
mythread.Start();
public void myserver()
char d;
IPAddress ipad1 = IPAddress.Parse("10.128.1.116");
TcpListener tcpc = new TcpListener(ipad1, 80);
tcpc.Start();
// System.Diagnostics.Process.Start(@"C:\Users\PC\Documents\Visual Studio 2010\Projects\WindowsFormsApplication1\webs\webs\clientconsole\clientconsole\bin\Debug\clientconsole.exe");
Console.WriteLine("server is running at port 80");
Console.WriteLine("local end point is" + tcpc.LocalEndpoint);
Console.WriteLine("waiting for connection");
// var client=new TestExecutionEngine
Socket s = tcpc.AcceptSocket();
Console.WriteLine("connection is accepted from" + s.RemoteEndPoint);
byte[] b = new byte[100];
int k = s.Receive(b);
Console.WriteLine("received");
for (int i = 0; i < k; i++)
d = Convert.ToChar(b[i]);
Console.WriteLine(char.ToUpper(d));
ASCIIEncoding asc = new ASCIIEncoding();
s.Send(asc.GetBytes("msg is recveived"));
Console.WriteLine("\n send aknwldge");
s.Close();
tcpc.Stop();
protected override void OnStop()
EventLog.WriteEntry("stopped");kavya --
You have erroneously posted this question in a user forum dedicated to questions about Project Online, an enterprise project management application. I would recommend you repost your question in a user forum that deals with C sharp programming questions.
Hope this helps.
Dale A. Howard [MVP]
Maybe you are looking for
-
Creating Profile type report that hold fields with multiple values
Really hoping someone can please help me out as I am very new to Crystal Reports. We use Maximizer CRM and we have been in need of some custom reports to rule out risk for regulators. I contacted Max and they suggested the only possible way is to cre
-
Error while updating the os on my iphone to 4.3.3 I get an error
I have been trying to upgrade the OS on my iPhone 3GS from 4.3.2 to 4.3.3 but I keep getting an error message as shown below. I have tried all the steps that are recommended to resolve the issue but nothing seems to work. Need help.........
-
How to redeploy Calculation Manager Web Application Server
Hi All, I am installing a patch(13925741) for Calculation Manager, i stuck at the following point: 6. Perform the standard Calculation Manager Web application server deployment task using Hyperion Enterprise Performance Management System Configurator
-
Archiving and different Retention period by specific interface
We want to specify different Retention period for different interfaces (audit reasons)... and based on search in SDN, it does not seem like this is supported by SAP... Do any of you know if SAP intends to support this in future? Any ideas for overco
-
Dealer Portal - Vehicle Sales - Maintain more selection Criteria
Hi, In Dealer Portal, Vehicle Sales --> Work Overview, I am getting the below error. Error message: Maintain more selection Criteria. What configuration is missing? I am Portal consultant, Please provide step by step procedure to fix this. Kindly sup