#include #include long _get_bootdrv(void) { return (long)*((int *)0x446); } int das_boot(void) { return (int)Supexec(_get_bootdrv); } char *auto_prgms = "A:\\AUTO\\*.PRG"; char *auto_all = "A:\\AUTO\\*.PR?"; char *auto_new = "!A:\\NEW_AUTO\\"; main() {DTA file_info; int boot_drv,end_of_file_list; char line[50]; Fsetdta(&file_info); boot_drv = das_boot(); auto_prgms[0] += boot_drv; auto_all[0] += boot_drv; auto_new[1] += boot_drv; auto_new[0] = '!'; /* put the execute command before all programs */ Cconws("; First make a exit key. If you press SPACE before this\r\n" "; the computer will start without autoprograms.\r\n" "D* ; set some default key.\r\n" "? X; if SPACE have been pressed, eXit\r\n\r\n" "; Execute all the current active programs from the auto folder\r\n"); end_of_file_list = Fsfirst(auto_prgms, 0); while (!end_of_file_list) { strncpy(line, file_info.d_fname, 14); Cconws(auto_new); Cconws(line); Cconws("\r\n"); end_of_file_list = Fsnext(); } Cconws("\r\n; Now list all active and disabled programs.\r\n"); auto_new[0] = ';'; /* put a comment before all programs */ end_of_file_list = Fsfirst(auto_all, 0); while (!end_of_file_list) { strncpy(line, file_info.d_fname, 14); Cconws(auto_new); Cconws(line); Cconws("\r\n"); end_of_file_list = Fsnext(); } return 0; }