Jump to content

Windows Media Player batch file


jdobros

Recommended Posts

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

:start

cls

echo ******************************************************************

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


@echo off

start /b cmd /c "C:\windows\clock.avi"

PING 1.1.1.1 -n 1 -w 13000 > NUL

taskkill /IM wmplayer.exe

Sub 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

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 by iamtheky
Link to comment
Share on other sites

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

start "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

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-sp

Possibly :unsure: 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.shtml

WV PLAYER

Play all your Multimedia files... can play any multimedia files, from

sound to movies, WAV, MIDI, MPG, AVI, MP3, ... in fact anything you

want, provided you have all the necessary filters and codecs available

in 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...