1.

Solve : This works but i'm sure there's a shorter (correct) way.?

Answer»

Hey guys, the object is to play a wav file in media player
for 37 secs. then close media player. Invisible would also be nice.
I came up with the batch file below, after a few days of learning about batch files.
I had seen a method with /play /close but that hasn't WORKED. I'm running xp, media player 11.

Start C:\chimes.wav
ping -n 38 127.0.0.1 >NUL
tskill wmplayer
EXIT







You can use a third PARTY program for a timed delay.
In my box of lost programs there is one called SLEEP.COM that lets you specify how many seconds to wait.
I can't find the link for it. I will come back later.

Yea, i have a little "SLEEP" app i could use, the closing and invisibility of wmplayer were the parts of the batch i was more curious about.
just for my own knowledge.

thanks.
H.Quote

the closing and invisibility of wmplayer were the parts of the batch i was more curious about.

By opening chimes.wav, you are presumably opening wmplayer indirectly thru the file association. You need to send a start /MIN parameter directly to the player.

Code: [Select]@echo off
Start /min wmplayer C:\chimes.wav
ping -n 38 127.0.0.1 >NUL
tskill wmplayer
exit

Don't worry about the sleep command (it comes with the Win2003 toolkit). Ping is perfectly serviceable.


thanks a lot SIDEWINDER, APPRECIATE it


Discussion

No Comment Found