This forum requires Javascript to be enabled for posting content
Log In
Please consider registering
Guest
Forum Scope


Match



Forum Options



Min search length: 3 characters / Max search length: 84 characters
Register Lost password?
automatically close WMP after playing a file
thebluejay
18 Posts
(Offline)
1
July 3, 2009 - 4:41 pm

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.

Chad Johnson
867 Posts
(Offline)
2
July 3, 2009 - 10:04 pm

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.

David Hartsock
1117 Posts
(Offline)
3
July 4, 2009 - 9:38 am

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!

thebluejay
18 Posts
(Offline)
4
July 5, 2009 - 8:43 am

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!)

Mindblower
Montreal, Canada
666 Posts
(Offline)
5
July 5, 2009 - 11:51 am

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!

"For the needy, not the greedy"

thebluejay
18 Posts
(Offline)
6
July 5, 2009 - 3:28 pm

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.

David Hartsock
1117 Posts
(Offline)
7
July 5, 2009 - 4:25 pm

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/.

thebluejay
18 Posts
(Offline)
8
July 6, 2009 - 7:27 am

[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.

David Hartsock
1117 Posts
(Offline)
9
July 6, 2009 - 9:38 am

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!

thebluejay
18 Posts
(Offline)
10
July 6, 2009 - 10:02 am

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 )

Chad Johnson
867 Posts
(Offline)
11
July 7, 2009 - 2:07 pm

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.

thebluejay
18 Posts
(Offline)
12
July 7, 2009 - 4:22 pm

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.

David Hartsock
1117 Posts
(Offline)
13
July 9, 2009 - 1:27 am

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.

thebluejay
18 Posts
(Offline)
14
July 10, 2009 - 10:55 am

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!

Jim Hillier
2700 Posts
(Offline)
15
July 10, 2009 - 6:14 pm

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
All RSSShow Stats
Administrators:
Jim Hillier
Richard Pedersen
David Hartsock
Moderators:
Carol Bratt
dandl
Jason Shuffield
Jim Canfield
Terry Hollett
Stuart Berg
John Durso
Top Posters:
Chad Johnson: 867
Mindblower: 666
carbonterry2: 356
Flying Dutchman: 278
grr: 211
Newest Members:
blutsband
cyberguy
JudeLandry
benjaminlouis680309
drogers97439
Forum Stats:
Groups: 8
Forums: 20
Topics: 1942
Posts: 13520

 

Member Stats:
Guest Posters: 11
Members: 3179
Moderators: 7
Admins: 3
Most Users Ever Online: 2303
Currently Online:
Guest(s) 17
Currently Browsing this Page:
1 Guest(s)
Exit mobile version

WHY NOT SUBSCRIBE TO OUR NEWSLETTER?

Get great content like this delivered to your inbox!

It's free, convenient, and delivered right to your inbox! We do not spam and we will not share your address. Period!