Two Scripts: START then END Application

JOSHSKORN

New member
Member
VIP
Local time
6:59 AM
Messages
121
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 Computer

Computer Manufacturer/Model Number
N/A
OS
Windows 7 Ultimate 64-bit
CPU
E6750 OC'd ~ 2.9 Mhz
Motherboard
P5N-E
Memory
DDR2 800 MHz 4GB
Graphics Card(s)
GTX 460 SE 1GB
Sound Card
Realtek Audio (Onboard sound)
Hard Drives
Seagate 500 GB HD
PSU
750 watt
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
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 Computer

Computer Manufacturer/Model Number
N/A
OS
Windows 7 Ultimate 64-bit
CPU
E6750 OC'd ~ 2.9 Mhz
Motherboard
P5N-E
Memory
DDR2 800 MHz 4GB
Graphics Card(s)
GTX 460 SE 1GB
Sound Card
Realtek Audio (Onboard sound)
Hard Drives
Seagate 500 GB HD
PSU
750 watt
If there is a space, enclose it in double quotes.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Back
Top