Solved Clickable service start/stop cmd or bat file. Possible?

Holy Moses

Banned
Local time
8:46 AM
Messages
92
Location
Ft. St. John
Not sure if I labelled this post right, or if I am even posting this in the right category/forum.

If admins could direct this if need be, that would be cool.

What I would like to do is have some kind of .cmd or .bat file that will turn on or restart my PS3 Media Server service, just by clicking it.
Maybe one that stops the service as well, or even one that can restart it.

I currently have a shortcut to services on the desktop, but it can be annoying when I have to restart the server numerous times because of various issues, and I have to scroll thru all the services, find PS3 Media Serve service, right click, restart.
When I start PS3 Media server as a task (so you can see the GUI), with the .exe file, you simply save your settings, hit Quit, then click the .exe on the desktop and VOILA, settings saved, and server restarted.

With the service installed and enabled, you can't quickly access the GUI and see your buffer or other values as running two instances of javaw.exe makes things go all screwy.

So, with the service, in order to change settings, I have to disable the service, then click the PMS.exe on my desktop so that PMS opens as a task. I then change any settings, save them, quit the GUI, then open services, and restart the service.
And the "restart http server" option has been broke for some time now. There are so many issues right now with PMS that many people don't want the extra headache of solving service issues, and most use a shortcut copy of their .exe in their shell:startup folder.

I figure if I can have some kind of quick way to make the service stop, click the .exe, do my thing with settings in the GUI (task startup), then close and click something to make the service start again.

I know this sounds like I am being lazy, but if someone could point me in the right direction on how to do this, my serving world would be greatly improved.

First off is this possible? Second, where and what would I even look up. Creating working .cmd or .bat files is WAAAY out of my league. I have learned how to edit some in PMS for Java heap settings to maximize my buffer capacity, but starting/creating such an option is beyond me.

If anyone needs anymore info, glad to give it. I asked a while back in the forums over there, but my thread got overlooked, and I find that stuff like this is better left to....well.....the pros. :D

Any ideas, and thanks in advance. Looking forward to learning something new. :cool:
 
Last edited:

My Computer My Computer

Computer Manufacturer/Model Number
Acer Aspire 6930///Compaq Presario SR5152NX
OS
Windows 7 Professional 32-bit///Vista Home Premium 32-bit
Memory
3GB RAM///2GB RAM
Graphics Card(s)
Built-in, crap///NVIDIA GeForce 6150SE nForce 430
Sound Card
Built-in, alright///Realtek HD audio
Monitor(s) Displays
Built in and 26" LCD/40" LCD (VGA splitter)
Screen Resolution
Laptop: 1366X768 26"Mon: 1366X768 40"Mon:1920X1080
Hard Drives
Internal 350GB///250GB
2 Seagate 1TB HDD Ext.
1 Verbatim 500GB HDD Ext.
Cooling
Stock fans
Keyboard
Intelli-Type Wireless multimedia keyboard
Mouse
MS Wireless Notebook Optical Mouse 3000
Internet Speed
15Mbps Telus DSL
Other Info
2 PS3's, 1 XBOX360, and a Panasonic Blu-Ray player rendering media to various locations in house via PS3 Media Server*****
DIR-655 Xtreme N Gb router w/DAP-1522 bridge/access point******Using Input Director to share keyboard and mouse across all screens and PC's in my room.
You can use the netsh tool (netsh.exe) to automate the control of services - add a suitably edited batch file or even a scheduled task, to run the following ...


As admin.

start a service:
Net start service_name

stop a service:
Net stop service_name


or as user or admin

Pausing a service:
Net pause service_name

Resuming a service:
Net continue service_name

To crate the Bat file

create a new text document - and add the command above on a separate line
save the .txt file

Rename the text file to have a bat extension
you will get a warning that changing an extension is not a good idea, but in this instance it is OK
 

My Computers My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    ChillBlast - Custom to my design
    OS
    Windows 11 Pro x64 [Latest Release and Release Preview]
    CPU
    Ryzen 9 5950X, 3.8 - 5.2 MHz
    Motherboard
    Asus Prime X570-Pro
    Memory
    64GB [2 x 32GB] DDR4 3200MHz
    Graphics Card(s)
    4GB NVIDIA GEFORCE GTX 1650 Ti
    Sound Card
    On-board SPDIF to 5.1 System + HDMI [5.1 system]
    Monitor(s) Displays
    32" UHD 32 Bit HDR Monitor + 43" UHD 4K 32Bit HDR TV
    Screen Resolution
    2 x 3840 x 2160 @60Hz
    Hard Drives
    1TB M2 SSD OS, 500GB Fast Access SSD, 2 x 8TB Data + Various Externals from 1TB to 4TB, 10TB NAS
    PSU
    NZXT C750 80 PLUS Gold 750W Modular PSU
    Case
    Workstation Case [Matt Black]
    Cooling
    NZXT Kraken X63 280mm CPU Cooler +2x Quiet Case fans
    Keyboard
    Logitech Wireless MX Keys & K400 + others
    Mouse
    Logitech Wireless MX Master 3S
    Internet Speed
    920 MB Down 50 MB Up
    Antivirus
    BitDefender Total Security Pro
    Browser
    Chrome (always run latest Non-Beta)
    Other Info
    Also run ...
    Laptop - Quad 8GB - Windows 10 Pro x64
    Nexus 7 Android tablet x2
    Samsung 10.2" tablet
    Blackview TAB 8 4G Android Tablet c/w Keyboard
    Wacom Intuos Pro Medium Pen Pad
    Wacom Intuos Pro Small Pen Pad
    Wacom Expresskeys Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control
  • Computer type
    Laptop
    System Manufacturer/Model Number
    Dell XPS 17 10750H
    OS
    Windows 11 Pro x64 Latest RP
    CPU
    Intel I7 10750H 5.0GHz
    Motherboard
    Dell XPS
    Memory
    32GB [2x16GB] DDR4 2933 MHz
    Graphics Card(s)
    nVidia GTX1650Ti 4 GB GDDR6
    Sound Card
    Stock [Realtek] 4 Speaker
    Monitor(s) Displays
    17" IPS UHD+ Infinity Edge Touchscreen
    Screen Resolution
    3840 x 2400
    Hard Drives
    2TB M2 NVMe, 4TB External + various 500GB & 1TB External NVMe (also have access to spinner HDD from
    PSU
    Stock
    Case
    Stock XPS Aluminium & Carbon Fibre
    Cooling
    Stock - Active Fan Control
    Keyboard
    Backlit + Various Logitech
    Mouse
    Stock Track Pad + Logitech MX Trackball
    Internet Speed
    72 MB Down 18MB Up
    Browser
    Chrome
    Other Info
    Also run ...
    Laptop - Quad 8GB - Windows 10 Pro x64
    Nexus 7 Android tablet x2
    10.2" tablet
    Sony Z3 Android Smartphone
    Wacom Intuos Pro Medium Pen Pad
    Wacom Intuos Pro Small Pen Pad
    Wacom Expresskeys Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control Pad
    10TB NAS
Also, you will need to have 'Hide extensions of all known file types' unchecked too in order to change the extension.

Capture.PNG
   Tip
Explorer -> 'Organize' -> 'Folder and Search options' -> View



OS
 

My Computer My Computer

Computer Manufacturer/Model Number
Compaq Desktop
OS
Windows 7 Ultimate x64
CPU
AMD Sempron Dual Core
Memory
3GB
Graphics Card(s)
NVIDIA GeForce 6150SE nForce 430
Screen Resolution
1024x768
Hard Drives
150GB Sata
Cool, I will give this a try and let you know how I make out. Hope it works, thank you very much Nigel.

EDIT: and thank you to Orbital Shark, good point, though I already have file extensions visible. But this will hopefully help others who might want to do this, so thank you.:cool:
 

My Computer My Computer

Computer Manufacturer/Model Number
Acer Aspire 6930///Compaq Presario SR5152NX
OS
Windows 7 Professional 32-bit///Vista Home Premium 32-bit
Memory
3GB RAM///2GB RAM
Graphics Card(s)
Built-in, crap///NVIDIA GeForce 6150SE nForce 430
Sound Card
Built-in, alright///Realtek HD audio
Monitor(s) Displays
Built in and 26" LCD/40" LCD (VGA splitter)
Screen Resolution
Laptop: 1366X768 26"Mon: 1366X768 40"Mon:1920X1080
Hard Drives
Internal 350GB///250GB
2 Seagate 1TB HDD Ext.
1 Verbatim 500GB HDD Ext.
Cooling
Stock fans
Keyboard
Intelli-Type Wireless multimedia keyboard
Mouse
MS Wireless Notebook Optical Mouse 3000
Internet Speed
15Mbps Telus DSL
Other Info
2 PS3's, 1 XBOX360, and a Panasonic Blu-Ray player rendering media to various locations in house via PS3 Media Server*****
DIR-655 Xtreme N Gb router w/DAP-1522 bridge/access point******Using Input Director to share keyboard and mouse across all screens and PC's in my room.
To add to that what Nigel told:

Command net stop service_name stops the named service, net start service_name starts itas Nigel mentioned. When you have saved it as a batch-file with extension .bat, you can not run it by double clicking because to start or stop services, you need built-in administrator rights. The option Run as administartor is grayed out in batch file properties, it can not be chosen. You can run the batch to start or stop a service only by right clicking it and choosing Run as administrator from context menu.

BatchProperties.png

A simple workaround is to create a shortcut to that batch file. Also in Shortcut properties is the option Run as administrator grayed out, if you look the Compability tab. But shortcut properties also has a Shortcut tab, where you can choose Advanced and surprise surprise, another place to choose run as administrator.

ShortcutProperties.png

Now you can double click the shortcut to run your batch files as administrator. UAC still prompts asking are you sure, but at least you don't have to run your batch from context menus, simple double click and telling UAC "yes, I'm sure" is enough.

Capture.PNG

If using notepad, remember to choose Save as type All files to avoid otherwise automatically added .txt file extension, and add the .bat extension to the file name.

NetStopBat.png

Kari
 
Last edited:

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
Ok. I tried to stop the service via the command line in netsh>

I entered :

net stop PS3 Media Server

Reply: The following command was not found: net stop PS3 Media Server

I then tried:

net stop PS3_Media_server (because of the way you wrote your description)

Reply: same as before.

Am I doing something inherently wrong here? I have started and stopped a service or two with this method ( I am pretty sure) but it was a while back.

I could try doing the .txt file do .bat thing and enter the values, but I figured if I can't get it to do it at the command line, I must not have it correct, and making a .bat file would be a waste of time. Please tell me it is something silly and easy to remedy.

EDIT: @ Kari......Thanks for that tip to enable double click. Now, I run the hidden admin account, or super admin, whatever the hell it is called. I have UAC disabled and never have admin issues and don't see those annoying pop up, "are you sure" windows......only with permissions if I unplug a HDD or move an already shared folder or something then my admin rights can be jeopardized.

I know UAC is there for a reason, but I just have to have it disabled.:eek: It just drives me nuts.

Definitely a cool workaround, if I can figure out the proper syntax, or line command....whatever it would be referred to as.
 
Last edited:

My Computer My Computer

Computer Manufacturer/Model Number
Acer Aspire 6930///Compaq Presario SR5152NX
OS
Windows 7 Professional 32-bit///Vista Home Premium 32-bit
Memory
3GB RAM///2GB RAM
Graphics Card(s)
Built-in, crap///NVIDIA GeForce 6150SE nForce 430
Sound Card
Built-in, alright///Realtek HD audio
Monitor(s) Displays
Built in and 26" LCD/40" LCD (VGA splitter)
Screen Resolution
Laptop: 1366X768 26"Mon: 1366X768 40"Mon:1920X1080
Hard Drives
Internal 350GB///250GB
2 Seagate 1TB HDD Ext.
1 Verbatim 500GB HDD Ext.
Cooling
Stock fans
Keyboard
Intelli-Type Wireless multimedia keyboard
Mouse
MS Wireless Notebook Optical Mouse 3000
Internet Speed
15Mbps Telus DSL
Other Info
2 PS3's, 1 XBOX360, and a Panasonic Blu-Ray player rendering media to various locations in house via PS3 Media Server*****
DIR-655 Xtreme N Gb router w/DAP-1522 bridge/access point******Using Input Director to share keyboard and mouse across all screens and PC's in my room.
You run net stop and net start from command prompt (as administrator).

The syntax you need is net stop "ps3 media server". By adding the " you're telling it to look for the string value name of the service.

Capture.PNG
 

My Computer My Computer

Computer Manufacturer/Model Number
Compaq Desktop
OS
Windows 7 Ultimate x64
CPU
AMD Sempron Dual Core
Memory
3GB
Graphics Card(s)
NVIDIA GeForce 6150SE nForce 430
Screen Resolution
1024x768
Hard Drives
150GB Sata
Try

net stop "PS3 Media Server"
net start "PS3 Media Server"
 

My Computer My Computer

Computer Manufacturer/Model Number
Too many to describe...
OS
Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
You run net stop and net start from command prompt (as administrator).

The syntax you need is net stop "ps3 media server". By adding the " you're telling it to look for the string value name of the service.

View attachment 112139

Bingo! I don't remember having to add the quotes, but that did it. Immediately, my server disconneted, then reconnected with the start command.

Also was doing it from the netsh> line. Probably not right either.

but now I feel confident in it working. Thank you to ALL!:party:

Very cool info, and you guys amaze me how fast you recall this info when needed. AWESOME.

Cheers, you have just added the cherry on top for my server now. I don't think I can tweak it any better than it is now. :huh: Well maybe......lol!!!
 

My Computer My Computer

Computer Manufacturer/Model Number
Acer Aspire 6930///Compaq Presario SR5152NX
OS
Windows 7 Professional 32-bit///Vista Home Premium 32-bit
Memory
3GB RAM///2GB RAM
Graphics Card(s)
Built-in, crap///NVIDIA GeForce 6150SE nForce 430
Sound Card
Built-in, alright///Realtek HD audio
Monitor(s) Displays
Built in and 26" LCD/40" LCD (VGA splitter)
Screen Resolution
Laptop: 1366X768 26"Mon: 1366X768 40"Mon:1920X1080
Hard Drives
Internal 350GB///250GB
2 Seagate 1TB HDD Ext.
1 Verbatim 500GB HDD Ext.
Cooling
Stock fans
Keyboard
Intelli-Type Wireless multimedia keyboard
Mouse
MS Wireless Notebook Optical Mouse 3000
Internet Speed
15Mbps Telus DSL
Other Info
2 PS3's, 1 XBOX360, and a Panasonic Blu-Ray player rendering media to various locations in house via PS3 Media Server*****
DIR-655 Xtreme N Gb router w/DAP-1522 bridge/access point******Using Input Director to share keyboard and mouse across all screens and PC's in my room.
Thanks for your kind words and we're always glad to help :)

Please enjoy the rest of the forums :)
 

My Computer My Computer

Computer Manufacturer/Model Number
Compaq Desktop
OS
Windows 7 Ultimate x64
CPU
AMD Sempron Dual Core
Memory
3GB
Graphics Card(s)
NVIDIA GeForce 6150SE nForce 430
Screen Resolution
1024x768
Hard Drives
150GB Sata
And I would like to post that my .bat files work brilliantly. The only thing better would be a way to make the command window auto-close after each start or stop. But that is being pretty picky....lol

I didn't need to follow Kari's advice as they worked immediatly with the double click.....probably because I'm signed into my super admin account. But I guess I could use Kari's info to allow me to make .bat files that work for other users so they can start or stop the service easily.

AWESOME!!!!!!:party::party::party::party::party::party::cool::cool::cool::cool::cool::sleepy::sleepy::sleepy::sleepy::sleepy:

Going to bed......lol! Tooooooo much partying. Thanks guys.

If there is a way to mark this topic as solved, I would appreciate that very much.
 

My Computer My Computer

Computer Manufacturer/Model Number
Acer Aspire 6930///Compaq Presario SR5152NX
OS
Windows 7 Professional 32-bit///Vista Home Premium 32-bit
Memory
3GB RAM///2GB RAM
Graphics Card(s)
Built-in, crap///NVIDIA GeForce 6150SE nForce 430
Sound Card
Built-in, alright///Realtek HD audio
Monitor(s) Displays
Built in and 26" LCD/40" LCD (VGA splitter)
Screen Resolution
Laptop: 1366X768 26"Mon: 1366X768 40"Mon:1920X1080
Hard Drives
Internal 350GB///250GB
2 Seagate 1TB HDD Ext.
1 Verbatim 500GB HDD Ext.
Cooling
Stock fans
Keyboard
Intelli-Type Wireless multimedia keyboard
Mouse
MS Wireless Notebook Optical Mouse 3000
Internet Speed
15Mbps Telus DSL
Other Info
2 PS3's, 1 XBOX360, and a Panasonic Blu-Ray player rendering media to various locations in house via PS3 Media Server*****
DIR-655 Xtreme N Gb router w/DAP-1522 bridge/access point******Using Input Director to share keyboard and mouse across all screens and PC's in my room.
Type the line @echo off as the first line of the bat file
and add the exit line to the end line

this should auto close although the default should be to close at the end of file anyway :confused:
 

My Computers My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    ChillBlast - Custom to my design
    OS
    Windows 11 Pro x64 [Latest Release and Release Preview]
    CPU
    Ryzen 9 5950X, 3.8 - 5.2 MHz
    Motherboard
    Asus Prime X570-Pro
    Memory
    64GB [2 x 32GB] DDR4 3200MHz
    Graphics Card(s)
    4GB NVIDIA GEFORCE GTX 1650 Ti
    Sound Card
    On-board SPDIF to 5.1 System + HDMI [5.1 system]
    Monitor(s) Displays
    32" UHD 32 Bit HDR Monitor + 43" UHD 4K 32Bit HDR TV
    Screen Resolution
    2 x 3840 x 2160 @60Hz
    Hard Drives
    1TB M2 SSD OS, 500GB Fast Access SSD, 2 x 8TB Data + Various Externals from 1TB to 4TB, 10TB NAS
    PSU
    NZXT C750 80 PLUS Gold 750W Modular PSU
    Case
    Workstation Case [Matt Black]
    Cooling
    NZXT Kraken X63 280mm CPU Cooler +2x Quiet Case fans
    Keyboard
    Logitech Wireless MX Keys & K400 + others
    Mouse
    Logitech Wireless MX Master 3S
    Internet Speed
    920 MB Down 50 MB Up
    Antivirus
    BitDefender Total Security Pro
    Browser
    Chrome (always run latest Non-Beta)
    Other Info
    Also run ...
    Laptop - Quad 8GB - Windows 10 Pro x64
    Nexus 7 Android tablet x2
    Samsung 10.2" tablet
    Blackview TAB 8 4G Android Tablet c/w Keyboard
    Wacom Intuos Pro Medium Pen Pad
    Wacom Intuos Pro Small Pen Pad
    Wacom Expresskeys Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control
  • Computer type
    Laptop
    System Manufacturer/Model Number
    Dell XPS 17 10750H
    OS
    Windows 11 Pro x64 Latest RP
    CPU
    Intel I7 10750H 5.0GHz
    Motherboard
    Dell XPS
    Memory
    32GB [2x16GB] DDR4 2933 MHz
    Graphics Card(s)
    nVidia GTX1650Ti 4 GB GDDR6
    Sound Card
    Stock [Realtek] 4 Speaker
    Monitor(s) Displays
    17" IPS UHD+ Infinity Edge Touchscreen
    Screen Resolution
    3840 x 2400
    Hard Drives
    2TB M2 NVMe, 4TB External + various 500GB & 1TB External NVMe (also have access to spinner HDD from
    PSU
    Stock
    Case
    Stock XPS Aluminium & Carbon Fibre
    Cooling
    Stock - Active Fan Control
    Keyboard
    Backlit + Various Logitech
    Mouse
    Stock Track Pad + Logitech MX Trackball
    Internet Speed
    72 MB Down 18MB Up
    Browser
    Chrome
    Other Info
    Also run ...
    Laptop - Quad 8GB - Windows 10 Pro x64
    Nexus 7 Android tablet x2
    10.2" tablet
    Sony Z3 Android Smartphone
    Wacom Intuos Pro Medium Pen Pad
    Wacom Intuos Pro Small Pen Pad
    Wacom Expresskeys Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control Pad
    10TB NAS
Back
Top