home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
lan
/
qrev1.arc
/
Q.BAT
< prev
next >
Wrap
DOS Batch File
|
1987-07-05
|
3KB
|
108 lines
echo off
if exist c:\batch\down. goto NOT_UP
if %1.BAT == .BAT goto CHECK_QUEUE
if %1 == ? goto ERROR
if %1 == Q goto QUIT
if %1 == q goto QUIT
if %1 == D goto DELETE
if %1 == d goto DELETE
if exist c:\batch\quit. goto NO_QUEUE
if not exist %1.BAT goto NO_FILE
:QUEUE3
if exist c:\batch\in3.bat goto QUEUE2
type c:\batch\cd > c:\batch\in3.bat
cd >> c:\batch\in3.bat
type %1.bat >> c:\batch\in3.bat
set N=3
echo %1%.BAT > c:\batch\Q3
goto SENTOK
:QUEUE2
if exist c:\batch\in2.bat goto queue1
type c:\batch\cd > c:\batch\in2.bat
cd >> c:\batch\in2.bat
type %1.bat >> c:\batch\in2.bat
set N=2
echo %1%.BAT > c:\batch\Q2
goto SENTOK
:QUEUE1
if exist c:\batch\in1.bat goto holdoff
type c:\batch\cd > c:\batch\in1.bat
cd >> c:\batch\in1.bat
type %1.bat >> c:\batch\in1.bat
set N=1
echo %1%.BAT > c:\batch\Q1
goto SENTOK
:SENTOK
echo Batch process %1 now queued as %N%.
goto END
:HOLDOFF
beep /f600 /d5
echo The queue is full. Please retry later.
goto CHECK_QUEUE
:QUIT
echo Sending QUIT command.
copy c:\batch\null c:\batch\quit > nul
goto END
:ERROR
echo ------------------------------------------------------------
echo Syntax is: Q [{batch file}] / [Q] / [D {batch number}] / [?]
echo ------------------------------------------------------------
echo Entering Q by itself will display the current queue status
echo {batch file} is the name of the file to be processed
echo Q terminates remote processing
echo D deletes batch request {batch number}
echo ? displays this message.
echo ------------------------------------------------------------
goto END
:NO_FILE
beep /f400 /d10
echo Cannot find %1.BAT
goto END
:NO_QUEUE
beep /f400 /d10
echo Quit command has been sent to remote system. No further queuing allowed.
goto END
:NOT_UP
beep /f400 /d10
echo The remote system is not operating. No queing is possible.
goto END
:DELETE
if %2.O == .O goto ERROR
if not exist c:\batch\Q%2. beep /f400 /d10
if not exist c:\batch\Q%2. echo Batch job %2 is not in the Queue; Cannot delete.
if not exist c:\batch\Q%2. goto CHECK_QUEUE
if exist c:\batch\RQ%2 beep /f400 /d10
if exist c:\batch\RQ%2 echo Job %2 is currently running; Cannot delete.
if exist c:\batch\RQ%2 goto CHECK_QUEUE
del c:\batch\Q%2.
del c:\batch\IN%2.BAT
echo Batch job %2 is removed from the queue.
:CHECK_QUEUE
echo -------------------------------
echo List of processes now in queue:
if exist c:\batch\Q1 echo ----- 1 -------
if exist c:\batch\RQ1 echo (RUNNING)
if exist c:\batch\Q1 type c:\batch\Q1
if exist c:\batch\Q2 echo ----- 2 -------
if exist c:\batch\RQ2 echo (RUNNING)
if exist c:\batch\Q2 type c:\batch\Q2
if exist c:\batch\Q3 echo ----- 3 -------
if exist c:\batch\RQ3 echo (RUNNING)
if exist c:\batch\Q3 type c:\batch\Q3
echo -------------------------------
goto END
:END