Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


Sign in to follow this  
Followers 0
jdobros

Windows Media Player batch file

8 posts in this topic

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

0

Share this post


Link to post
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.

0

Share this post


Link to post
Share on other sites

This seemed to work...almost...

I placed the video in the c:\windows directory

when i ran the batch file, the player launched, but the video failed to play....

it did shutdown the player properly

0

Share this post


Link to post
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
0

Share this post


Link to post
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?

0

Share this post


Link to post
Share on other sites

Try to install codec package like K-Lite or some else. I think this will solve Your problem.

0

Share this post


Link to post
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

0

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.