home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / reboot.zip / REBOOT.C20 next >
Text File  |  1993-09-26  |  586b  |  31 lines

  1. #define INCL_DOS
  2. #include <os2.h>
  3. #define DOSS          "\\DEV\\DOS$"
  4. #define CATEGORY_DOSSYS 0xD5
  5. #define FUNCTION_REBOOT 0xAB
  6. main()
  7. {
  8. SHORT rc ;
  9. HFILE hDD ;
  10. ULONG usAction ;
  11. rc = DosOpen ( DOSS, &hDD, &usAction,
  12.                0L, FILE_NORMAL,
  13.                FILE_OPEN, OPEN_SHARE_DENYNONE |
  14.                OPEN_ACCESS_READWRITE, 0L );
  15. if (!rc)
  16.    {
  17.    DosDevIOCtl ( hDD,
  18.               CATEGORY_DOSSYS,
  19.               FUNCTION_REBOOT,
  20.               0L,
  21.               0L,
  22.               0L,
  23.               NULL,
  24.               0L,
  25.               0L );
  26.  
  27.    DosClose ( hDD );
  28.    }
  29. return 0 ;
  30. }
  31.