Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Two Scripts: START then END Application

07 Jan 2011   #1
JOSHSKORN

Windows 7 Ultimate 64-bit
 
 
Two Scripts: START then END Application

I'm running low on resources and am not wanting to upgrade, so it looks like a script to the rescue! Basically I work with Oracle 11g on my computer. Here are the 2 scripts that I'm looking to do. Please help. Thanks.

Script 1: Start Oracle 11g
Code:
START Service A
START Service B
START Service C
START Service D

WAIT Until Service A, Service B, Service C, Service  D is STARTED

'Services A-D all MUST be running BEFORE continuing

Check to see if PROCESS A.exe is running

'PROCESS A.exe MUST be running before continuing.  Process A will automatically execute after the said services above are started.

Access Program LNK
Here's Script #2. Note that I will close the program by itself, I just need to stop associated services and processes.

Code:
STOP Service A
STOP Service B
STOP Service C
STOP Service D

END Process.exe A



My System SpecsSystem Spec
.
07 Jan 2011   #2
Ztruker

Windows 10 Pro X64
 
 

Do you really mean services or do you mean programs?

To start services you use net start xxxxxx
To stop services you use net stop xxxxxx

You can use tasklist to see if a process is running tasklist | find "xxxxxx.exe" but I can't seem to get it to work right in a batch file. If I can then I believe you can also use ERRORLEVEL to determine if the process is running or not. I'll play with it some more ...
My System SpecsSystem Spec
07 Jan 2011   #3
JOSHSKORN

Windows 7 Ultimate 64-bit
 
 

Quote   Quote: Originally Posted by Ztruker View Post
Do you really mean services or do you mean programs?

To start services you use net start xxxxxx
To stop services you use net stop xxxxxx

You can use tasklist to see if a process is running tasklist | find "xxxxxx.exe" but I can't seem to get it to work right in a batch file. If I can then I believe you can also use ERRORLEVEL to determine if the process is running or not. I'll play with it some more ...
So having that said, here is a work in progress:

Script 1:

Code:
net start OracleDBConsoleorcl
net start OracleMTSRecoveryService
net start OracleOraDb11g_home1TNSListener
net start OracleServiceORCL

'Need code to wait until oracle.exe Process is running

'Need code to access application LNK
Script 2:

Code:
net stop OracleDBConsoleorcl
net stop OracleMTSRecoveryService
net stop OracleOraDb11g_home1TNSListener
net stop OracleServiceORCL

'Need code to END oracle.exe process
One thing I'm curious about. Does the name of the service need quotation marks? What if the service in question had a space in it? (i.e. Plug and Play)
My System SpecsSystem Spec
.

08 Jan 2011   #4
Ztruker

Windows 10 Pro X64
 
 

If there is a space, enclose it in double quotes.
My System SpecsSystem Spec
Reply

 Two Scripts: START then END Application




Thread Tools




Similar help and support threads
Thread Forum
cmd.exe application error - application was unable to start correctly
cmd.exe application error - application was unable to start correctly (0x0000142). Click ok to close the application Anyone know why it happened? I got this error when I tried to restart to install an update. However, in windows update, it showed I had nothing to update. There was the little...
General Discussion
Inexplicable application start-up lag
A mysterious problem has cropped up in the last few days. At random times my OS hangs when trying to start up applications or browse. I have to wait up to 20 to 30 seconds to even open up a Notepad file. It feels like the hard disk slows to a crawl, but when I check the resource monitor nothing is...
Performance & Maintenance
Application Does Not Start in Windows 7
I recently installed a new 60GB SSD as my primary hard drive and re-installed Windows 7 Professional 64-bit. I then installed SSD Fresh from Abelssoft to optimize Windows to run on the SSD. It seemed to install okay, but when I try to run the utility, its splash screen appears briefly before it...
Software
Win XP Mode - Cannot start virtual application. The application is blo
Our office has an old program that we still need to use when upgrading our PC's to Windows 7. The program will run fine if you start a windows virtual PC and install and run it. However, based on the needs of our office, I need to be able to run Windows XP mode and simply have an icon for our users...
Virtualization
Start Menu Application Take Time To Start
The problem that i am facing is that, my windows 7 search is instantaneous but when i click on the application the application takes time to load but if i run the same application from Desktop it will load immediately. This happens only one first time after bootup. does any1 else face the same...
General Discussion
How to start any application with windows
Hello! Can you tell me how to start any program with windows. I have IObi advanced system care i want start its Network monitor with windows i added its shortcuts to start menu "start-up" but its not start-up with window why is that? How do i solve this issue?...
Software


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:34.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App