Run, %comspec% /k test1.cmd, %A_WorkingDir%
the batch file is:
Code: Select all
@echo off
TITLE Computer used by
cls
mode 400,35
color 5
query user /server:vComputer | findstr "Active"
IF %ERRORLEVEL% EQU 0 (
call
) else (
echo ^>^> The computer is free for use.
)
echo.
pause