automatically close WMP after playing a file

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_topic_old
automatically close WMP after playing a file
Avatar
thebluejay
Member
Forum Posts: 18
Member Since:
November 12, 2008
sp_UserOfflineSmall Offline
1
July 3, 2009 - 4:41 pm
sp_Permalink sp_Print

Sorry, I couldn't find a category in which to post this so...

I am trying to find a way to automatically close Windows Media Player 9.0 running under Win2K.

I have tried using
"C:Program FilesWindows Media Playerwmplayer.exe" /play /close "%1"
as my command line in the file options of WMV files but it doesn't work for me.

Any other way to do this? I want the Media Player to close automatically when it has finished playing a file. Will some type of DDE entries do the trick?

Thanks.

Avatar
Chad Johnson
Mod
Forum Posts: 867
Member Since:
August 11, 2011
sp_UserOfflineSmall Offline
2
July 3, 2009 - 10:04 pm
sp_Permalink sp_Print

um...i use the 'X' button when it's done.

though i will admit, it's not automatic, it's worked great for me in the past.

so far as i know, WMP does not have command line options to do anything like this. i don't think there's anything in the preferences. there wasn't that i could see.

one option would be to use a killall utility that would let you close the wmplayer process after a set time. you could get the length of your playlist and kinda hack it together that way.

maybe someone else will have heard of something to do this.

Avatar
David Hartsock
Admin
Forum Posts: 1105
Member Since:
August 7, 2011
sp_UserOfflineSmall Offline
3
July 4, 2009 - 9:38 am
sp_Permalink sp_Print

Can you give us a little more info and detail about what you are trying to accomplish? I know you're trying to close WMP, but why, what is the scenario, etc.

I've got a few ideas, but more info will help!

Avatar
thebluejay
Member
Forum Posts: 18
Member Since:
November 12, 2008
sp_UserOfflineSmall Offline
4
July 5, 2009 - 8:43 am
sp_Permalink sp_Print

Hello! How can I make it more clear? When I open a video file, WMP opens and plays it. After WMP plays the video, I want WMP to close automatically (without my having to click on the X!)

Avatar
Mindblower
Montreal, Canada
Member
Forum Posts: 411
Member Since:
September 17, 2008
sp_UserOfflineSmall Offline
5
July 5, 2009 - 11:51 am
sp_Permalink sp_Print

Just adding my 2 cents worth here, but I've not come across any player (audio or video) that does what you want. I know some programs give you options (close, shut the computer), so I wish you luck.

I find Spider Player (freeware version) does an excellent job playing audio files, Mindblower!

"Light travels faster than sound;
That is why some people seem bright until you hear them speak"

Avatar
thebluejay
Member
Forum Posts: 18
Member Since:
November 12, 2008
sp_UserOfflineSmall Offline
6
July 5, 2009 - 3:28 pm
sp_Permalink sp_Print

For those of you who may not know it, VLC Player offers an option to close the program after playing the file but I am not crazy about its other features.

Media Player Classic works if you add "%1" /play /close to the command line. It is what I am using now until (or if!) I can find a way to do it in WMP.

Avatar
David Hartsock
Admin
Forum Posts: 1105
Member Since:
August 7, 2011
sp_UserOfflineSmall Offline
7
July 5, 2009 - 4:25 pm
sp_Permalink sp_Print

OK, I wasn't trying to nib, just get a little more info - things are not always as they seem.

I believe WMP does not require the "%1" part of the switch - wmplayer.exe /play /close C:musicSample.wma

If the above doesn't work and you have no luck with other switch combos you can try NirCmd from NirSoft - http://www.nirsoft.net/utils/nircmd.html. You can use nircmd to close any app after a specified amount of time and quite a bit more. Check out the help file.

You could also use AutoHotKey.exe to build a script that would do it - http://www.autohotkey.com/.

Avatar
thebluejay
Member
Forum Posts: 18
Member Since:
November 12, 2008
sp_UserOfflineSmall Offline
8
July 6, 2009 - 7:27 am
sp_Permalink sp_Print

[quote:hjc5c8f4]I believe WMP does not require the "%1" part of the switch - wmplayer.exe /play /close C:musicSample.wma[/quote:hjc5c8f4]

I think you are right about the %1 Dave. I guess I just add it automatically out of habit. Does no harm but no need for it as you say. But whether I put it in or not makes no difference--close will not work.

[quote:hjc5c8f4]If the above doesn't work and you have no luck with other switch combos you can try NirCmd from NirSoft - http://www.nirsoft.net/utils/nircmd.html. You can use nircmd to close any app after a specified amount of time and quite a bit more. Check out the help file.[/quote:hjc5c8f4]

I checked out nircmd. Pretty neat, but it won't do what I want. As far as I can see, it is a stand-alone program which will do all kinds of things from a command line but it does not seem to operate as a switch which I could add to the command line in my wmv file functions. Instead, it is necessary to create a batch file or a shortcut to operate the nircmd and since this requires input, it kind of defeats the purpose of the exercise. I tried using it as a switch by adding nircmd.exe killprocess /964 and assorted variations but they will not run in switch format ( with or without the forward slash).

[quote:hjc5c8f4]You could also use AutoHotKey.exe to build a script that would do it - http://www.autohotkey.com/.[/quote:hjc5c8f4]
Autokey presents the same problem. I could write a script to close the program but input of some kind would be required to activate it.

I like the way you're thinking outside the box though. Pretty clever suggestions.

Avatar
David Hartsock
Admin
Forum Posts: 1105
Member Since:
August 7, 2011
sp_UserOfflineSmall Offline
9
July 6, 2009 - 9:38 am
sp_Permalink sp_Print

I haven't tried this, but you might look into ProcessGuard - http://www.donationcoder.com/Software/S ... sGuard.exe

It can monitor a particular process for CPU usage, RAM, or idle time and do a bevy of tasks based on those parameters.

Here is code for AutoHotKey that monitors a process for idle time and kills it.
[code:2vqx3l8i];kill certain programs after x hours of idle time
#Persistent
AutoExec8:
SetTimer, AutoKill, 25000
;
; 3600000 milliseconds = 1 hour
; 5400000 milliseconds = 1,5 hours
; 7200000 milliseconds = 2 hours
; 7200000 milliseconds = 2 hours
; 9000000 milliseconds = 2,5 hours
;
AutoKill:
; TrayTip, test, test
If A_TimeIdlePhysical > 5400000
process, close, fdm.exe
If A_TimeIdlePhysical > 9000000
process, close, [b]winamp.exe[/b]
return[/code:2vqx3l8i]

You should be able to change the process (winamp.exe) and modify the length.

If that doesn't work my only suggestion would be to register at Donation Coder and ask for help in the Coding Snacks forum. I hate to send you to another site, but there are some very intelligent folks over there that live to write software!

Sorry we couldn't be of more help!

Avatar
thebluejay
Member
Forum Posts: 18
Member Since:
November 12, 2008
sp_UserOfflineSmall Offline
10
July 6, 2009 - 10:02 am
sp_Permalink sp_Print

That won't be of much help either because I would have to specify the time of each file that was run since they are all different.

I guess I will stick with media player classic for now since it seems to do what I want.

Thanks for the input Dave!

(And I think your newsletter is one of the best )

Avatar
Chad Johnson
Mod
Forum Posts: 867
Member Since:
August 11, 2011
sp_UserOfflineSmall Offline
11
July 7, 2009 - 2:07 pm
sp_Permalink sp_Print

bluejay, the beauty of the autohotkey script is that it monitors for idle time.

so when the file is down playing and wmp is just sitting there, it should hit an idle state (minimum CPU, RAM use etc) and that's what it looks for.

However, I'm not sure what, if anything, WMP is doing when it just sits there. It may not ever drop to idle.

Avatar
thebluejay
Member
Forum Posts: 18
Member Since:
November 12, 2008
sp_UserOfflineSmall Offline
12
July 7, 2009 - 4:22 pm
sp_Permalink sp_Print

Now I'm totally lost. There appears to be no documentation around to explain how Process Guard installs and works. I downloaded it and ran it and was told it could not find the Task Manager, Who knew it needed that? LOL I tried putting the app in my Task Manager Folder (I'm using the Anvir Task Manager so that might have been an issue) and again nothing happened. So I moved it to the System 32 folder with taskmgr.exe. No joy. No idea how the program starts or works or how to get it to do what I want to do. If I need to write a script to tell it what to do, where do I store it and how does it get started?
A little arcane for me without some instructions.

Avatar
David Hartsock
Admin
Forum Posts: 1105
Member Since:
August 7, 2011
sp_UserOfflineSmall Offline
13
July 9, 2009 - 1:27 am
sp_Permalink sp_Print

I'm pretty sure that Process Guard polls the windows task manager only. Try making the Windows Task Manager the default and give Process Guard another shot.

Avatar
thebluejay
Member
Forum Posts: 18
Member Since:
November 12, 2008
sp_UserOfflineSmall Offline
14
July 10, 2009 - 10:55 am
sp_Permalink sp_Print

I thought I had posted a reply to this suggestion but it seems to have disappeared. Was it because I mention GAOTD? (hmmmm...)

I mentioned that I did not want to disable the AnVir Task Manager because once I uninstalled it, I would not be able to reinstall it since it was a freebie that I really love from GAOTD.

It appears that there is no reasonable way to make WMP do what I want it to do so I am just going to stick with Media Player Classic - I now have the Home Cinema version and I can configure it as I please.

Been fun working on the problem with you Dave. Thanks!

Avatar
Jim Hillier
Admin
Forum Posts: 2492
Member Since:
August 9, 2011
sp_UserOfflineSmall Offline
15
July 10, 2009 - 6:14 pm
sp_Permalink sp_Print

Hey Bluejay - I can assure you, there is no way anyone here would delete or edit your post merely because you mentioned GAOTD....just would not happen. Anyway, if any member's post was deleted/edited, they would be notified by private message detailing the reasons...out of courtesy. That is the way we do things here.

I sometimes 'think' I have done something but later realise I must have just thought about doing it and not actually carried through...mind you, I am getting on a bit!!

cheers mate...JIM

B.T.W: Really appreciate you posting back and letting us know the outcome.

Forum Timezone: America/Indiana/Indianapolis

Most Users Ever Online: 188

Currently Online:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Member Stats:

Guest Posters: 10

Members: 1272

Moderators: 3

Admins: 4

Forum Stats:

Groups: 8

Forums: 19

Topics: 1538

Posts: 11824

Administrators: Jim Hillier, Richard Pedersen, David Hartsock, Marc Thomas

Moderators: Judy Novotny, Jason Shuffield, Mail Poet