home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / OS2KILL.ZIP / OS2KILL.C < prev    next >
C/C++ Source or Header  |  1992-07-08  |  2KB  |  55 lines

  1. /* os2kill.c
  2.  
  3.    A program to remove OS2 system files from the root directory. Don't
  4.      run this under OS/2 or a DOS Window!  Run from the root directory
  5.      in DOS non-protected mode (normal DOS).  Will delete hidden and
  6.      non-dos files like 'WP ROOT. SF'  This can free up a lot of
  7.      space.
  8.  
  9.    compiled under Microsoft C 5.1   ( Bill Gates would be proud!)
  10.  
  11.    written to delete OS/2 version 2.00 GA.
  12.  
  13.    Copyright (C) 1992, Hobbitt Software
  14.  
  15.    This program is FREE.  It is distributed under the agreement as
  16.      set forth by the GNU project.  The agreement is not included
  17.      to save space but it may be obtained from any GNU product.  Or,
  18.      you could just re-write this and call it your own but I'm on the
  19.      GNU bandwagon, their concept of freedom of information , and taking t
  20.      his oportunity to tell you to check 'em out.
  21.  
  22.    Stephen Balbach -> 'Lieben is Lieben'
  23.  
  24. */
  25.  
  26.  
  27. #include <io.h>
  28. #include <stdio.h>
  29. #include <dos.h>
  30.  
  31. main()
  32. {
  33. char ch;
  34.  
  35.  
  36.   printf("\nYou are about to kill OS2, repairable only by re-installation.\n");
  37.   printf("\nkillos2.exe must be run from the root directory of the drive OS/2 is installed\n\n");
  38.   printf("Press 'y' to kill, any other to live: ");
  39.   ch = getch();
  40.   if(ch == 'y')
  41.   {
  42.     printf("\n\nChange 'wp root. sf' attribute = %d (0 if OK)\n", _dos_setfileattr("wp root. sf",_A_NORMAL));
  43.     printf("Delete 'wp root. sf'           = %d (0 if OK)\n", remove("wp root. sf"));
  44.     printf("Change 'ea data. sf' attribute = %d (0 if OK)\n", _dos_setfileattr("ea data. sf",_A_NORMAL));
  45.     printf("Delete 'ea data. sf'           = %d (0 if OK)\n", remove("ea data. sf"));
  46.     printf("Change 'os2boot.   ' attribute = %d (0 if OK)\n", _dos_setfileattr("os2boot",_A_NORMAL));
  47.     printf("Delete 'os2boot.   '           = %d (0 if OK)\n", remove("os2boot"));
  48.     printf("Change 'os2krnl.   ' attribute = %d (0 if OK)\n", _dos_setfileattr("os2krnl",_A_NORMAL));
  49.     printf("Delete 'os2krnl.   '           = %d (0 if OK)\n", remove("os2krnl"));
  50.     printf("Change 'os2ldr.    ' attribute = %d (0 if OK)\n", _dos_setfileattr("os2ldr",_A_NORMAL));
  51.     printf("Delete 'os2ldr.    '           = %d (0 if OK)\n", remove("os2ldr"));
  52.   }
  53.  
  54. }
  55.