• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Overly complicated, but fun RadioDJ delayed start .bat file.

Started by Hidyman, January 14, 2023, 07:41:08 AM

Hidyman

I am moving my RadioDJ installation to a new machine and moving to RadioDJ version 2.
I sometimes go on little tangents while diving into these projects.
Thought I would share this batch program to delay the start of RadioDJ until after the database is running:

REM Copy Start

@ECHO off

TITLE ^>      -- Delayed Start of RadioDJ --
REM Change the value of _seconds_to_wait to the number of seconds you need to delay the start of RadioDJ
SET _seconds_to_wait=30
SET _space_count=%_seconds_to_wait%

:waitloop

   PING -n 2 127.0.0.1>nul
   SET /a "_seconds_to_wait-=1"
   SET _space_count=%_seconds_to_wait%
   SET "_spaces="
   
:fancyformat
   if %_space_count% NEQ 0 (
      SET _spaces= %_spaces%
      SET /a "_space_count-=1"
      goto fancyformat
      )
   
   CLS
   ECHO RadioDJ Activation Sequence
   ECHO:
   ECHO Starts in --^> %_spaces%^<--%_seconds_to_wait%
   
   if %_seconds_to_wait% NEQ 0 goto waitloop
   
:do_start
   CLS
   ECHO RadioDJ Activation Sequence
   ECHO:
   ECHO Starts in --^>X%_spaces%^<-- %_seconds_to_wait%
   ECHO:
   ECHO Activation Sequence Initiated
   TIMEOUT /T 3 /NOBREAK>nul
   ECHO:
   
   REM Change the second argument to the folder that contains your RadioDJ installation
   REM Change the third argument to the actual RadioDJ.exe file
   Start "RadioDJ Delayed Start" /D "C:\RadioDJv2\" "C:\RadioDJv2\RadioDJ.exe"
   
   If %errorlevel% EQU 0 (
      TIMEOUT /T 3 /NOBREAK>nul
      ECHO:
      ECHO RadioDJ startup is a SUCCESS!
      ECHO:
      TIMEOUT /T 10 /NOBREAK
      EXIT)
   
   ECHO:   
   ECHO Something went wrong!
   ECHO:
   PAUSE

EXIT

REM Copy End

Also attached is a text file that can be renamed to a .bat file.

Fulvietto

If you need to have e predefined startup sequence or simply have some program delayed i suggest the free version of this sw:
https://www.r2.com.au/page/products/download/startup-delayer/

I'm using it to have a start sequence such as:

at 10'' from start run program a
at 20'' ... program b
and so on

Even in the free version there are nice features such as delay start program b to wait program a full start or "run as administrator" privilege.