Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Windows Media Player batch file

- - - - -

  • Please log in to reply
7 replies to this topic

#1
jdobros

jdobros
  • Member
  • 3 posts
  • Joined 30-March 08
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


How to remove advertisement from MSFN

#2
iamtheky

iamtheky

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 866 posts
  • Joined 11-November 08
@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.
iamtheKy

#3
jdobros

jdobros
  • Member
  • 3 posts
  • Joined 30-March 08
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

#4
iamtheky

iamtheky

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 866 posts
  • Joined 11-November 08
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, 16 December 2008 - 01:46 PM.

iamtheKy

#5
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,593 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
Read this, just in case:
http://www.ss64.com/nt/start.html
(it could be also a "missing title" problem)

jaclaz

#6
iamtheky

iamtheky

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 866 posts
  • Joined 11-November 08
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?
iamtheKy

#7
belivakov

belivakov

    Newbie

  • Member
  • 36 posts
  • Joined 03-March 07
Try to install codec package like K-Lite or some else. I think this will solve Your problem.

#8
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,593 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

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...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..../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 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users