home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sftick.zip
/
beg
/
prog
/
PROG.C
< prev
next >
Wrap
Text File
|
1994-04-09
|
838b
|
32 lines
#define INCL_DOSPROCESS
#include <os2.h>
#include <stdio.h>
#define BUFFER_SIZE 200
INT main ( VOID )
{
APIRET arReturn ;
CHAR achFail [BUFFER_SIZE] ;
RESULTCODES rcResult ;
/* execute the OS/2 command session, and pass the command dir *.* */
arReturn = DosExecPgm ( achFail,
BUFFER_SIZE,
EXEC_ASYNC,
"CMD.EXE /C dir *.*\0",
(PSZ) NULL,
&rcResult,
"CMD.EXE" ) ;
/* print out return code */
if ( arReturn ) {
printf ( "\narReturn = %d", arReturn ) ;
} /* endif */
/* print out return from session */
printf ( "\nrcResult = %ld", rcResult.codeResult ) ;
return 0 ;
}