Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

WMP11 creating a BATCH file to enable/disable sharing - WMPNetwk.exe


  • Please log in to reply

#1
Tender_Prey

Tender_Prey

    New Member

  • Member
  • Pip
  • 8 posts
Hi,

I posted this in the Applications forum but perhaps it's better suited here:

Hi,

I hope someone can help.

I'm looking for a simple batch file i can run that will allow me to switch between enabled and disabled windows media player network sharing - without having to open WMP11 and manually turn on and off Media Sharing.

As far as i understand the service (services.msc) that needs switching is WMPNetworkSvc (Windows Media Player Network Sharing Service) which relates to WMPNetwk.exe

I should also add that it might be better if the Batch file just gave the command to "restart" the service as that might also solve my current issue.

Any help would be great

Many thanks

  • 0

Advertisements


#2
Ztruker

Ztruker

    Member 5k

  • Technician
  • 7,065 posts
Hi Tender_Prey, welcome.

The sc command should do what you want once you know the exact name of the service you want to enable/disable.

Open a command prompt and enter sc for usage information.

Open Services (Start / Run type services.msc and press Enter) and see if you can locate it there. If yes, double click on it. The service name is listed right near the top. Then enter

sc stop servicename

and

sc start service name

If they work then you put them in two batch files, one to start and one to stop.

With some work you can setup a single batch file to start it if stopped and stop it if started. You would use the

if [not] errorlevel number command [else expression]

format in the batch file. See here for batch file info: Command-line reference A-Z
  • 0

#3
Tender_Prey

Tender_Prey

    New Member

  • Topic Starter
  • Member
  • Pip
  • 8 posts
Hi Ztruker

Many thanks for the info it's a lot of help - i'll give it go

Cheers
John (tender prey)
  • 0

#4
Tender_Prey

Tender_Prey

    New Member

  • Topic Starter
  • Member
  • Pip
  • 8 posts
Hi,

The 2 simple SC bat files worked a treat, and i attempted to construct the "errorlevel" batch but to no success.

The service name is WMPNetworkSvc and i discovered that the errorlevel for the service whilst started is 4 and whilst stopped is 1 howwver i'm not sure of correct command lines to use to make the process start or stop.

I'm very much a newb to this stuff though i'm enjoying getting stuck in!
  • 0

#5
jnicholls08

jnicholls08

    Member

  • Member
  • PipPip
  • 35 posts
I am having this p[roblem and can not get any relief.... my 360 is connected directly to my pc via ethernet. Static Ip address set... the xbox network test clears however my WMP 11 will not acknowledge my 360. So through my travels on the web i have narrowed it down to my Windows Media Player Network Sharing Device... i start the process and it says it started and stopped. Something to due with programs that are not in use or something of that sort. I can not get this service to stay active... I have no idea about bat files or antyhing of that sort. can you help me?!?
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP