home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 February / psl_9403.zip / psl_9403 / DOS / UT_SYSTM / FORDO.ZIP / FORDO.C < prev    next >
C/C++ Source or Header  |  1993-12-13  |  1KB  |  55 lines

  1. /* Compile me with Turbo C */
  2.  
  3. #include <string.h>
  4. #include <dos.h>
  5. #include <process.h>
  6.  
  7. char msg1[] = "FORDO V1.01 - Tony Ingenoso\r\n\r\n"
  8.         "Note: '%%i' is the name of replaceable parm in DO part\r\n\r\n"
  9.         "Enter FOR specs  :$";
  10.  
  11. char msg2[] = "Enter thing to DO:$";
  12. char msg3[] = "\r\n$";
  13.  
  14. void main(void)
  15.         {
  16.         static unsigned char specs[120] = {115};
  17.         static unsigned char what[120]  = {115};
  18.         static unsigned char cmd[180] = " COMMAND /C FOR %i IN ( ";
  19.  
  20.         _DX = &msg1[0];     
  21.         _AH = 9;
  22.         geninterrupt(0x21);
  23.  
  24.         _DX = &specs[0];
  25.         _AL = 119;
  26.         _AH = 0x0A;
  27.         geninterrupt(0x21);
  28.  
  29.         _DX = &msg3[0];
  30.         _AH = 9;
  31.         geninterrupt(0x21);
  32.  
  33.         _DX = &msg2[0];
  34.         _AH = 9;
  35.         geninterrupt(0x21);
  36.  
  37.         _DX = &what[0];
  38.         _AL = 119;
  39.         _AH = 0x0A;
  40.         geninterrupt(0x21);
  41.  
  42.         _DX = &msg3[0];
  43.         _AH = 9;
  44.         geninterrupt(0x21);
  45.  
  46.         specs[specs[1] + 2] = 0;
  47.         what [what [1] + 2] = 0;
  48.  
  49.         strcat(cmd, specs+2);
  50.         strcat(cmd, " ) DO ");
  51.         strcat(cmd, what+2);
  52.         strcat(cmd, "\r\n");
  53.         system(cmd);
  54.         }
  55.