

InterviewSolution
Saved Bookmarks
1. |
Solve : Run Windows Media Player in Background? |
Answer» <html><body><p>Hi All,<br/><br/>I'm trying to right a batch file that will run a .wav file in WMP in the background so the user won’t see the WMP window. At the moment here is the following code I've written.<br/><br/>--------------------------------<br/>start /MIN "wmplayer.exe" "C:\Users\Owner\Desktop\wavFiles\8point1.wav"<br/>timeout /T 3<br/>taskkill/IM "wmplayer.exe"<br/>------------------------------------------------<br/><br/>The problem with this code is that the WMP window does show and does not even minimize!<br/><br/>Any help will be very much appreciated!<br/>Try this. It will use an older version of windows media player, but not to worry as the user probably wont see it anyway.<br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>start /min "" "C:\Program Files\Windows Media Player\mplayer2.exe" /play /close "C:\Users\Owner\Desktop\wavFiles\8point1.wav"Make sure the above is ONE LINE.Thanks Helpmeh for your quick reply!<br/><br/>1) I needed to change mplayer2.exe to wmplayer.exe otherwise I'm getting an error that it can't find mplayer2<br/><br/>2) After making the above change if WMP was in Restore mode last time it was open then the first time I run the bat file it executes as I want (the window is not visible) the second time it will show and stay open, if I close it manually and run it again it will run as I wanted the 4th time it won’t and so forth... If the WMP was Maximised last time it was open running the bat file will always run WMP in max mode and stay open.<br/> <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: Amram Chayim Eirinberg on February 20, 2010, 12:20:58 PM</p><blockquote>Thanks Helpmeh for your quick reply!<br/><br/>1) I needed to change mplayer2.exe to wmplayer.exe otherwise I'm getting an error that it can't find mplayer2<br/><br/>2) After making the above change if WMP was in Restore mode last time it was open then the first time I run the bat file it executes as I want (the window is not visible) the second time it will show and stay open, if I close it manually and run it again it will run as I wanted the 4th time it won’t and so forth... If the WMP was Maximised last time it was open running the bat file will always run WMP in max mode and stay open.<br/><br/></blockquote> Here is a link to download mplayer2.exe. It doesn't require any installation, just copy and past the following file into C:\Program Files\Windows Media Player\.<br/><br/>mplayer2.cnt<br/>mplayer2.exe<br/>mplayer2.hlp<br/>mplayer2.inf<br/>mplayer2.pnf<br/><br/>For some reason, the underlined file (mplayer2.exe) is the only file (in the list I gave) that is in my C:\Program Files\Windows Media Player\ folder, so copy that one first and try out my script. If it doesn't work, copy the rest.<br/>Where is the link? Quite strange...it must not have copied...lol<br/><a href="http://www.infocellar.com/winxp/files/mplayer-winxp-files.zip">http://www.infocellar.com/winxp/files/mplayer-winxp-files.zip</a>mplay32 and sndrec32 can also play .wav files.Thanks Prince! Hi Helpmeh<br/><br/><br/>I've updated the batch to mplayer2.exe however I'm getting an error message that the entry point was not found. <br/><br/>I've attached a jpg of the error message<br/><br/>[Saving space, attachment deleted by admin]I really have never seen that error before. It might be because it is for XP, not vista. <br/><br/>To make sure you don't have mplayer2.exe on you <a href="https://interviewquestions.tuteehub.com/tag/computer-243299" style="font-weight:bold;" target="_blank" title="Click to know more about COMPUTER">COMPUTER</a> (other than the one I gave you), do a search for it, and if it already exists, then it should work with that version. <br/><br/>there is no "mplayer2" included with windows vista.<br/><br/>use Windows Media Player Classic:<br/><br/><a href="https://www.afterdawn.com/software/video_software/video_players/media_player_classic.cfm/v6_4_9_1__20080127_">http://www.afterdawn.com/software/video_software/video_players/media_player_classic.cfm/v6_4_9_1__20080127_</a><br/><br/>the switches are pretty similar:<br/><br/> Quote<blockquote> <br/>Usage: mplayerc.exe "pathname" [switches]<br/><br/>"pathname" The main file or directory to be loaded. (wildcards<br/> allowed)<br/>/dub "dubname" Load an additional <a href="https://interviewquestions.tuteehub.com/tag/audio-245346" style="font-weight:bold;" target="_blank" title="Click to know more about AUDIO">AUDIO</a> file.<br/>/dubdelay "file" Load an additional audio file shifted with XXms (if<br/> file contains "...DELAY XXms...")<br/>/d3dfs start rendering in D3D fullscreen mode.<br/>/sub "subname" Load an additional subtitle file.<br/>/filter "filtername" Load DirectShow filters from a dynamic link<br/> library. (wildcards allowed)<br/>/dvd Run in dvd mode, "pathname" means the dvd<br/> folder (optional).<br/>/dvdpos T#C Start playback at title T, chapter C<br/>/dvdpos T#hh:mm Start playback at title T, position hh:mm:ss<br/>/cd Load all the tracks of an audio cd or (s)vcd,<br/> "pathname" means the drive path (optional).<br/>/open Open the file, don't automatically start playing.<br/>/play Start playing the file as soon the player is<br/> launched.<br/>/close Close the player after playback (only works when<br/> used with /play).<br/>/shutdown Shutdown the operating system after playback<br/>/fullscreen Start in full-screen mode.<br/>/minimized Start in minimized mode.<br/>/new Use a new instance of the player.<br/>/add Add "pathname" to playlist, can be combined<br/> with /open and /play.<br/>/regvid Create file associations for video files<br/>/regaud Create file associations for audio files<br/>/unregall Remove all file associations<br/>/start ms Start playing at "ms" (= milliseconds)<br/>/startpos hh:mm:ss Start playing at position hh:mm:ss<br/>/fixedsize w,h Set fixed window size.<br/>/<a href="https://interviewquestions.tuteehub.com/tag/monitor-563344" style="font-weight:bold;" target="_blank" title="Click to know more about MONITOR">MONITOR</a> N Start on monitor N, where N starts from 1.<br/>/help /h /? Show help about command line switches<br/><br/></blockquote> <br/>so you would use:<br/><br/> Code: <a>[Select]</a><path to mplayerc>\mplayerc.exe /minimized "%UserProfile%\desktop\wavfiles\8point1.wav" /play /close<br/>Wouldn't /minimized go on the other side of the path, with the other switches?<br/> Quote<blockquote>Usage: mplayerc.exe "pathname" [switches]</blockquote> it doesn't matter.ok.</body></html> | |