Old 15th January 2021, 00:34   #1
Wadle
Junior Member
 
Join Date: Jan 2021
Posts: 3
Batch file help

My apologies if this has been covered. I couldn't find it via search.

I would like to create a simple batch file (not plugin) which PLAYS winamp if it gets stopped, paused, or otherwise not playing. I am not a coder. I managed to cobble together one that opens winamp and plays it, but not one that can restart it if it pauses/stops while open. I don't know enough about code for the IF/THEN commands. Any help would be appreciated.

Windows 10. Winamp V 5.8


@ECHO off
SET _PollingInterval=30

:BatchStart
"C:\Program Files (x86)\Winamp\Winamp" /PLAY

:Start
:: PING 127.0.0.1 -n %_PollingInterval% >nul
TIMEOUT /T %_PollingInterval%

SET PID=
FOR /F "tokens=2 delims= " %%i IN ('TASKLIST ^| FIND /i "subapp.exe"') DO SET PID=%%i
IF [%PID%]==[] (
ECHO Application was not running. Restarting script.
GOTO BatchStart
)
GOTO Start

GOTO:EOF
Wadle is offline   Reply With Quote
Old 15th January 2021, 03:06   #2
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,028
Send a message via Skype™ to thinktink
Try this instead and see if it works:
http://bogproghome.hopto.org/forums/...2b6f8fb1f4426a
thinktink is online now   Reply With Quote
Old 16th January 2021, 02:15   #3
Wadle
Junior Member
 
Join Date: Jan 2021
Posts: 3
Thank you! That seems to have done the trick. Much appreciated.
Wadle is offline   Reply With Quote
Old 16th January 2021, 02:20   #4
Wadle
Junior Member
 
Join Date: Jan 2021
Posts: 3
Batch file help

Actually it worked and then it didn't. Tested it a few times while open, pause, stop etc. Worked fine. Closed it completely and restarted, now not working. Am I missing something?
Wadle is offline   Reply With Quote
Old 17th January 2021, 03:05   #5
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,028
Send a message via Skype™ to thinktink
Do you know what's causing Winamp to stop playing?
thinktink is online now   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Technical Support

Tags
bat file pause/play

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump