Minimize a window when running a .bat

Solved
Ancor17 Posted messages 67 Status Member -  
Ancor17 Posted messages 67 Status Member -
Hello, I created a .bat file that opens a music file, I managed to set the execution of the .bat file to minimized mode but the music still opens in the player and the window opens fully on the screen.
Is there a way to minimize a window with a command in Batch?
There are many forums on this subject but I can't find anything that I can understand!
I'm not very good at Batch.

Thank you in advance for your answers.

3 answers

  1. f894009 Posted messages 17417 Registration date   Status Member Last intervention   1 717
     
    Hello,

    If you no longer need the back window, put exit after starting your music.
    0
    1. Ancor17 Posted messages 67 Status Member 21
       
      That's not the problem; I would like the music player's window to minimize to the taskbar after it launches.
      But thanks anyway for your response.
      0
      1. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930 > Ancor17 Posted messages 67 Status Member
         
        It's not possible, there is no internal command to do that.

        You have to rig things to achieve the desired result.
        0
  2. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930
     
    Hello,

    Which reader is it about?

    --

    “Artificial intelligence is defined as the opposite of natural stupidity.”
    0
    1. Ancor17 Posted messages 67 Status Member 21
       
      Which drive???

      The .bat file is on a USB stick but I don't understand how that can help me...
      0
    2. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930 > Ancor17 Posted messages 67 Status Member
       
      It's not because you don't understand that it can't help you.

      I'll start again: which music player?
      0
    3. Ancor17 Posted messages 67 Status Member 21
       
      Ah! the music player! Excuse me...
      Otherwise, the music player would be Windows Media Player
      0
    4. Ancor17 Posted messages 67 Status Member 21
       
      And I forgot to mention that I cannot modify the computer's settings, everything that needs to be done must be done through the .bat file.
      0
    5. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930 > Ancor17 Posted messages 67 Status Member
       
      I'm sorry, it's not possible to minimize the window with this player; I suggest you use VLC Portable available here:

      https://www.commentcamarche.net/telecharger/tv-video/23317-vlc-media-player/

      You need to install it on your USB drive.

      Give me the name and location of the music on your drive, and I'll prepare the script for you.
      0
  3. Ancor17 Posted messages 67 Status Member 21
     


    There is an execution error, I checked that the executable in the VLC folder is indeed named VLCPortable.exe.
    0
    1. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930
       


      @echo off
      setlocal enableextensions

      cd /d %~dp0 || exit /B 1

      if not exist "%cd%VLCPortable\VLCPortable.exe" (echo. & echo Please install VLC Portable on your USB drive)

      set musique=%cd%MUS\MUS.mp3

      start /D "%cd%VLCPortable" VLCPortable.exe --qt-start-minimized "%musique%"

      exit /B
      0
    2. Ancor17 Posted messages 67 Status Member 21
       
      Great! It's working really well now!
      Thank you so much barnabe0057!
      0