jdobros Posted December 16, 2008 Share Posted December 16, 2008 I want to place a batch file in the run once section on all computers to play a video once the user logs in using Windows Media Player.How do i properly have the Media Player exit once the video is played without user interaction:@echo off:startclsecho ******************************************************************echo * A Safety Video will now be played on your desktop *echo * Please turn your speakers on at this time if you *echo * have them *echo ******************************************************************echo.pause "C:\Program Files\Windows Media Player\wmplayer.exe" "C:\Program Files\Windows Media Player\safety.wmv" Any help would be appreciated...it's been a while in DOS world Link to comment Share on other sites More sharing options...
iamtheky Posted December 16, 2008 Share Posted December 16, 2008 @echo offstart /b cmd /c "C:\windows\clock.avi"PING 1.1.1.1 -n 1 -w 13000 > NULtaskkill /IM wmplayer.exeSub out your .AVI in the START and your length of time in the ping in miliseconds (13000=13sec). I played the 12 second clock (13 cause it goes back to one) then close it. Issuing a dead ping for that length of time to delay the taskkill.Its crude but functional. Link to comment Share on other sites More sharing options...
jdobros Posted December 16, 2008 Author Share Posted December 16, 2008 This seemed to work...almost...I placed the video in the c:\windows directorywhen i ran the batch file, the player launched, but the video failed to play....it did shutdown the player properly Link to comment Share on other sites More sharing options...
iamtheky Posted December 16, 2008 Share Posted December 16, 2008 (edited) are you still calling the media player seperately? edit: If so, i did not try it that way.Make a batch with just the 'start' line, the symptoms should be the same as if you double clicked the file. Edited December 16, 2008 by iamtheky Link to comment Share on other sites More sharing options...
jaclaz Posted December 16, 2008 Share Posted December 16, 2008 Read this, just in case:http://www.ss64.com/nt/start.html(it could be also a "missing title" problem)jaclaz Link to comment Share on other sites More sharing options...
iamtheky Posted December 16, 2008 Share Posted December 16, 2008 Purely for my education while I am learning new things about start.Is the "missing title problem" just folks putting the first argument in quotes i.estart "program.exe"thinking that they will execute the program rather than realizing they are specifying a title?Or are there other issues that arise? Link to comment Share on other sites More sharing options...
belivakov Posted December 16, 2008 Share Posted December 16, 2008 Try to install codec package like K-Lite or some else. I think this will solve Your problem. Link to comment Share on other sites More sharing options...
jaclaz Posted December 17, 2008 Share Posted December 17, 2008 Or are there other issues that arise?The "parsing engine" seem to expect that anything in the first couple of quotes is the title.http://stackoverflow.com/questions/72671/h...command-with-spPossibly also if the parameter(s) passed is/are enclosed in quotes could be "skipped".WV player may be an alternative:http://www.webxpace.com/software/freeware.shtmlWV PLAYERPlay all your Multimedia files... can play any multimedia files, fromsound to movies, WAV, MIDI, MPG, AVI, MP3, ... in fact anything youwant, provided you have all the necessary filters and codecs availablein your computer...........Can also work only from the command line, using a string like:"{path_to_program}\wv_player.exe" /n:x {path_to_file}\sound.wav"to play only the files and auto exit......This is preferrable as the accuracy of timing of the PING command and of the actual playback time, summed up to the opening of the player may prove to be inaccurate on different machines.jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now