Skip to content

Instantly share code, notes, and snippets.

@paveljurca
Last active July 25, 2017 07:17
Show Gist options
  • Save paveljurca/14741efdb67ef76f483e105a03bdc2e8 to your computer and use it in GitHub Desktop.
Save paveljurca/14741efdb67ef76f483e105a03bdc2e8 to your computer and use it in GitHub Desktop.
Play media files with CMD.exe

Play media files with CMD.exe

  1. Create this C:\AUTOEXEC.BAT
  2. cmd /c "%PLAY%Beatles - Yellow Submarine.mp3"

VLC.lnk %cd% starts playing in the cur dir.

Or go default

(and easy)

Command Extensions are

  • turned ON

    • "Beatles - Yellow Submarine.mp3"
  • turned OFF

    • explorer "Beatles - Yellow Submarine.mp3"

    explorer works much like open on Mac and xdg-open on GNU/Linux.

To change Default Programs use assoc and ftype.

AUTOEXEC.BAT

Since any SET statement in C:\AUTOEXEC.BAT are parsed at boot time and since other than setting environment variables is ignored

AUTOEXEC.bat define environment variables global to all users

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun with %USERPROFILE%\bin\env.cmd

set " displays undocumented system variables.

doskey dirall=dir /a: $1 dir all files.

aliases https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt

@PATH %USERPROFILE%\bin
@PATH %USERPROFILE%\Desktop
@SET PLAY=start VLC.lnk ^"^%cd^%\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment