jeudi 31 août 2017

Batch File use to run command immediately, now there is a delay of 10-12 seconds

I haven't changed anything in the file, and it worked perfectly for over a month, but now this delay is really starting to annoy me and I can't for the life of me figure out how to fix it.

@echo off

Setlocal EnableDelayedExpansion

set "Music_PATH=C:\Music\ESmusic"
set counter=0

for /f "tokens=*" %%a in ('forfiles /p "%Music_PATH%" /m *mp3') do (
set Rand_PATH[!counter!]=%%~nxa
set /a counter+=1
)

set /a Random_Music=%random% %% %counter%
set "Full_PATH=%Music_PATH%\!Rand_PATH[%Random_Music%]!"

echo Random Music & echo. & echo !Rand_PATH[%Random_Music%]!
start "" "%Full_PATH%"

Timeout 23
taskkill /f /IM winamp.exe


pause >nul

Here is the file for reference. Any and all help is appreciated!




Aucun commentaire:

Enregistrer un commentaire