home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
iplpau.zip
/
iplpause.c
next >
Wrap
Text File
|
1993-12-05
|
3KB
|
81 lines
/**********************************************************************/
/* PROGRAM: IPLPAUSE.EXE - config.sys timer utility. */
/* BY: Knight Research - Copyright (c) 1993 All Rights Reserved. */
/* Version: 1.1 Last Update: December 5, 1993 */
/**********************************************************************/
/* Compiled with MSC 6.0 */
#define INCL_DOSPROCESS
#define INCL_DOSMISC
#include <os2.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
int key;
char szInput[80];
USHORT usRC, usSeconds=0;
RESULTCODES resc;
UCHAR szFailName[CCHMAXPATH];
UCHAR szCommandLine[] = { "cmd\0 /K \0" };
UCHAR szDefault_ComSpec[] = { "C:\\OS2\\CMD.EXE" };
UCHAR *pszComSpec;
/***************************************************************************/
void main (int argc, char *argv[])
/***************************************************************************/
{
if (argc > 1) {
strcpy(szInput,argv[1]);
strupr(szInput);
usSeconds = atoi(szInput);
}
if (usSeconds == 0)
usSeconds = 10;
/*************************** Try to find CMD.EXE **************************/
if (argc > 2) { /* CMD.EXE Passed as a Parm */
pszComSpec = &argv[2][0];
printf("\nMSG:1 Parm Passed COMSPEC=%s\n",pszComSpec);
}
else if (0 == (DosScanEnv("COMSPEC", &pszComSpec))) { /* from Environment */
printf("\nMSG:2 Found COMSPEC=%s\n",pszComSpec);
} /* Using CMD.EXE pointed to in environment 'SET COMSPEC=' parm */
else { /* take default location */
pszComSpec = &szDefault_ComSpec[0];
printf("\nMSG:3 Using Default COMSPEC=%s\n",pszComSpec);
}
printf("┌─────────────────────────────────────────────────────────────────────┐\n");
printf("│IPLPAUSE: Knight Research - Copyright \(c\) 1993 All Rights Reserved. │\n");
printf("└─────────────────────────────────────────────────────────────── 1.1 ─┘\n");
printf("Press ANY KEY to PAUSE System Startup...OR Press <ESC> to Continue NOW.\n\n");
while (usSeconds > 0) {
if (kbhit()) {
key = getch();
if (key != 27) {
printf("\n\nIPL has been Paused....type EXIT to continue system startup.\n\n");
usRC = DosExecPgm(szFailName, sizeof(szFailName), EXEC_SYNC,
szCommandLine, (PSZ) NULL, &resc, pszComSpec);
if (usRC != 0) {
printf("\n\aIPL has NOT been Paused. BAD RC=%d\n", usRC);
printf("COMSPEC USED WAS: %s\n", pszComSpec);
}
printf("\n\nOS/2 Presentation Manager will now start.\n\n");
exit(1);
}
else {
printf("\n\nOS/2 Presentation Manager will now start.\n\n");
exit(0); /* Boot Immediately */
}
}
DosSleep(1000L);
usSeconds--;
printf("===> COUNTDOWN TO PM STARTUP: %d \r", usSeconds);
}
printf("\n\nOS/2 Presentation Manager will now start.\n\n");
exit(0);
}