Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
@ECHO OFF
setlocal enabledelayedexpansion



::This is a placeholder file to check if VBScript is running
SET File="%TEMP%\jobrunning.log"
del /F /Q %File% 2>NUL

::Set arrsize -1
set  arrsize=4
set  arrayline[0]=1A
set  arrayline[1]=2A
set  arrayline[2]=3A
set  arrayline[3]=4A
set  arrayline[4]=5A

::read it using a FOR /L statement
for /l %%n in (0,1,%arrsize%) do (
copy /y NUL %TEMP%\jobrunning.log >NUL
TIMEOUT 2
CALL :file_exists
echo !arrayline[%%n]!
)
PAUSE

GoTo :EOF

:Is Job Still Running?
:file_exists
   IF EXIST %File% (
       GoTo :file_exists
) ELSE (
EXIT /B
)
  • No labels