Playing invisible music using a batch file?

I saw cfew streams that say how to play music with playback minimized when it starts with start /min , as well as one that creates a VBS script to start minimizing sound. But no matter how I try to start the sound to minimize, it appears on the screen.

Also, if I try start /min or start /max , I will get the same result.

Does anyone know how I can start to minimize something?

+7
batch-file hidden audio
source share
11 answers
 @echo off set "file=track12.mp3" ( echo Set Sound = CreateObject("WMPlayer.OCX.7"^) echo Sound.URL = "%file%" echo Sound.Controls.play echo do while Sound.currentmedia.duration = 0 echo wscript.sleep 100 echo loop echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs start /min sound.vbs 

just change track12.mp3 to the name of your audio file

+12
source share

This is a copy / paste from another answer (also me) that included this as a possible answer to one of the points (playing a wav file without a visible application) of the question.

For the sound part, as far as I know, there is no way to directly play the custom wav from the command line without spawning another process. Common tools are vlc, wmplayer, vbs file installation omx wmplayer, sound recorder, powershell, ... All these parameters are described in previous questions (only in the first) here in stackoverflow or here in superuser.

An extension of one of the alternatives, if you have access to some C compiler (checked using mingw), this code will generate a console tool that calls the PlaySound API PlaySound , passing the first argument as a file for playback.

 #include <windows.h> int main(int argc, char **argv) { if (argc < 2) return 1; if (!PlaySound( argv[1], NULL, SND_FILENAME | SND_NODEFAULT | SND_SYNC ) ) return 2; return 0; } 

Depending on your configuration, you will need to include the link in the Winmm library for the linker.

+3
source share
 CreateObject("Wscript.Shell").Run "wmplayer /play /close ""Your file location here""", 0, False 
+1
source share

Obviously, it’s very late for the question seeker, but who knows? Someone else can watch. So I’ll just repeat Tony DB’s answer from April 14th, and since someone complained that it was just code, I’ll add a little explanation, and really very little is required.

1.) Open Windows Notepad

2.) Copy the Tony BD code into Notepad

3.) Replace “Your file’s location here” with the full path to the music file that you want to play.

4.) From the Notepad menu, select "File | Save As.",

5.) Select a location and give the file a name, but make sure that instead of the standard file type .txt you give it the ending .vbs.

6.) Close Notepad

7.) Click on the vbs file you just created and your music file will start playing without displaying anything on the screen.

Parameter 0 in the code allows WMP to open in an invisible window. If you change 0 to 1, you will see the WMP GUI.

Obviously, this is available only for Windows users, but for them it is the best and easiest solution to the problem.

+1
source share

If you can use a third-party utility, then wv_player is a free media player with a simple gui and has command line switches for playing media files without an interface.

0
source share

Batch Music Player.bat

 @echo off setlocal enabledelayedexpansion Set vbsfile=%temp%\Intro.vbs Set URL=http://hackoo.alwaysdata.net/Intro_DJ.mp3 Call:Play %URL% %vbsfile% Start %vbsfile% Set MyFile=%~f0 Set ShorcutName=DJ Batch Music Player ( echo Call Shortcut("%MyFile%","%ShorcutName%"^) echo ^'**********************************************************************************************^) echo Sub Shortcut(CheminApplication,Nom^) echo Dim objShell,DesktopPath,objShortCut,MyTab echo Set objShell = CreateObject("WScript.Shell"^) echo MyTab = Split(CheminApplication,"\"^) echo If Nom = "" Then echo Nom = MyTab(UBound(MyTab^)^) echo End if echo DesktopPath = objShell.SpecialFolders("Desktop"^) echo Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^) echo objShortCut.TargetPath = Dblquote(CheminApplication^) echo ObjShortCut.IconLocation = "Winver.exe,0" echo objShortCut.Save echo End Sub echo ^'********************************************************************************************** echo ^'Fonction pour ajouter les doubles quotes dans une variable echo Function DblQuote(Str^) echo DblQuote = Chr(34^) ^& Str ^& Chr(34^) echo End Function echo ^'********************************************************************************************** ) > %temp%\Shortcutme.vbs Start /Wait %temp%\Shortcutme.vbs Del %temp%\Shortcutme.vbs ::**************************************************************************************************** Title DJ Batch Music Player by Hackoo 2015 :menuLOOP Color 0A & Mode con cols=78 lines=25 echo( echo =============================================================== echo "/ | / | / | "; echo "$$ | $$ | ______ _______ $$ | __ ______ ______ "; echo "$$ |__$$ | / \ / |$$ | / | / \ / \ "; echo "$$ $$ | $$$$$$ |/$$$$$$$/ $$ |_/$$/ /$$$$$$ |/$$$$$$ |"; echo "$$$$$$$$ | / $$ |$$ | $$ $$< $$ | $$ |$$ | $$ |"; echo "$$ | $$ |/$$$$$$$ |$$ \_____ $$$$$$ \ $$ \__$$ |$$ \__$$ |"; echo "$$ | $$ |$$ $$ |$$ |$$ | $$ |$$ $$/ $$ $$/ "; echo "$$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ $$$$$$/ $$$$$$/ "; echo " "; echo " "; echo( =============================Menu============================== echo( for /f "tokens=2* delims=_ " %%A in ('"findstr /b /c:":menu_" "%~f0""') do echo %%A %%B echo( echo( =============================================================== set choice= echo( & set /p choice=Make a choice or hit ENTER to quit: || GOTO :EOF echo( & call :menu_[%choice%] GOTO:menuLOOP ::******************************************************************************************** :menu_[1] Play DJ Buzz Radio cls & color 0A Call:SkipLine 10 Call:Tab 3 echo %x% Please Wait for a while .. Launching DJ Buzz Radio ... Taskkill /IM "wscript.exe" /F >nul 2>&1 Set vbsfile=%temp%\DJBuzzRadio.vbs Set URL=http://www.chocradios.ch/djbuzzradio_windows.mp3.asx Call:Play %URL% %vbsfile% Start %vbsfile% TimeOut /T 1 /NoBreak>nul GOTO:menuLOOP ::******************************************************************************************** :menu_[2] Play David Guetta Mix cls & color 0A Call:SkipLine 10 Call:Tab 3 echo %x% Please Wait for a while .. Launching David Guetta Mix ... Taskkill /IM "wscript.exe" /F >nul 2>&1 Set vbsfile=%temp%\David_Guetta_Miami.vbs Set URL=http://hackoo.alwaysdata.net/David_Guetta_Miami_2014.mp3 Call:Play %URL% %vbsfile% Start %vbsfile% TimeOut /T 1 /NoBreak>nul GOTO:menuLOOP ::******************************************************************************************** :menu_[3] Play Ibiza Mix cls & color 0A Call:SkipLine 10 Call:Tab 3 echo %x% Please Wait for a while .. Launching Ibiza Mix ... Taskkill /IM "wscript.exe" /F >nul 2>&1 Set vbsfile=%temp%\IbizaMix.vbs Set URL=http://hackoo.alwaysdata.net/IbizaMix.mp3 Call:Play %URL% %vbsfile% Start %vbsfile% TimeOut /T 1 /NoBreak>nul GOTO:menuLOOP ::******************************************************************************************** :menu_[4] Play Avicii Mega Mix cls & color 0A Call:SkipLine 10 Call:Tab 3 echo %x% Please Wait for a while .. Launching Avicii Megamix ... Taskkill /IM "wscript.exe" /F >nul 2>&1 Set vbsfile=%temp%\IbizaMix.vbs Set URL="http://hackoo.alwaysdata.net/Best of Avicii Megamix 2014.mp3" Call:Play %URL% %vbsfile% Start %vbsfile% TimeOut /T 1 /NoBreak>nul GOTO:menuLOOP ::******************************************************************************************** :menu_[5] Play Mega Mix 90 cls & color 0A Call:SkipLine 10 Call:Tab 3 echo %x% Please Wait for a while .. Launching Mega Mix 90 ... Taskkill /IM "wscript.exe" /F >nul 2>&1 Set vbsfile=%temp%\IbizaMix.vbs Set URL="http://hackoo.alwaysdata.net/Megamix 90.mp3" Call:Play %URL% %vbsfile% Start %vbsfile% TimeOut /T 1 /NoBreak>nul GOTO:menuLOOP ::******************************************************************************************** :menu_[6] Stop the music cls & color 0C Call:SkipLine 10 Call:Tab 3 echo %x% Please Wait for a while .. Stopping the music ... Taskkill /IM "wscript.exe" /F >nul 2>&1 TimeOut /T 1 /NoBreak>nul GOTO:menuLOOP ::******************************************************************************************** :Play ( echo Play "%~1" echo Sub Play(URL^) echo Dim Sound echo Set Sound = CreateObject("WMPlayer.OCX"^) echo Sound.URL = URL echo Sound.settings.volume = 100 echo Sound.Controls.play echo do while Sound.currentmedia.duration = 0 echo wscript.sleep 100 echo loop echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000 echo End Sub )>%~2 ::********************************************************************************************* :Tab set "x=" For /L %%I In (1,1,%1) Do Set "x=!x! " REM ^-- this is a TAB goto :eof ::********************************************************************************************* :SkipLine For /L %%I In (1,1,%1) Do Echo( Goto:Eof :EOF EXIT ::********************************************************************************************* 
0
source share

Most recommended is a MediaPlayer or relative ActiveX object . This can be a problem for people without MediaPlayer installed (for example, genuine authentication is required for Windows XP), and it can act differently in different versions of Windows (for example, closing some windows does not automatically close as expected). Here is my implementation (does not create temporary files). Example:

 call mediaRunner.bat "C:\Windows\Media\Ring05.wav" 

Each Windows computer has SP ActiveX objects that can run .wav files (without mp3, etc.). Here is one script . Example:

 call spPlayer.bat "C:\Windows\Media\Ring05.wav" 

and we also have HTA / InternetExplorer applications and the bgsound tag. Which also allows you to control the volume of the song being played :

 call htaplayer.bat "C:\Windows\Media\Ring05.wav" -1000 
0
source share

What I use: VLC (free download) for Windows. Works from XP to 10.

use this

 "c:\Program Files (x86)\videolan\vlc\vlc.exe" --qt-start-minimized --play-and-exit "c:\Program Files (x86)\videolan\vlc\Windows Exclamation.wav" 

Only paths and quotation marks; meat

 vlc --qt-start-minimized --play-and-exit soundFilename 
0
source share

Just use Sounder.exe

For example, your command line would be Sounder MyWaveFile.wav

Get it from

http://www.elifulkerson.com/projects/commandline-wav-player.php

0
source share

for mac it is.,.

 afplay (your music file name here) 

Note: It must be located in the iTunes folder in iTunes music.

0
source share

I ran into this problem yesterday when I was studying the problem that I had with the solution proposed in a different topic because it left Windows Media Player open. Starting with the C code provided by MC ND, I have compiled a slightly more polished and modern (widescreen) version that I just published under the BSD license with three offers on GitHub

All you really need to run is SoundOff_Binary.ZIP, which you can download yourself. If you also want a source, please feel free to clone the repository to local git. If you do, please take a moment to read the README.md file before trying to use it.

0
source share

All Articles