home *** CD-ROM | disk | FTP | other *** search
- /* RunForward utility Ver 3.0 by Federico Noferi 1990 */
- /* Attenzione: quando linkate Runf dovete linkarlo con */
- /* cback.o invece che con il classico c.o */
-
- #include"stdio.h"
- #include"string.h"
- #include"libraries/dosextens.h"
-
- #define title1 "RunForward utility Ver. 3.0 by Federico Noferi Running command: "
-
- #define msg1 "\nSintax : Runf command [parameters]\n\n"
- #define msg2 "RunForward utility Ver. 3.0 by Federico Noferi 1990\n"
- #define msg3 "Please reports all bugs and any suggestion \nto A-BBS +39-55-225727 24h or MC-Link MC7598 NUA 022226500140\n"
- #define msg4 "or write to: Fderico Noferi\n"
- #define msg5 " via Cavalcanti, 42\n"
- #define msg6 " Firenze 50133, Italy\n"
- #define msg7 " Tel. +39-55-572968"
-
- #define msgg1 "\n\nRunForward utility: Error executing the command\n"
- #define msgg2 "\nNote: run command must be present in C: directory\n"
-
-
- long _stack = 4000; /* Definizioni per usare il cback.o */
- char *_procname = "RunForward"; /* in modo che runf parta gia' in */
- long _priority = 0; /* multitasking. */
- long _BackGroundIO = 1;
- extern struct FileHandle *Open();
- main(argc,argv)
- int argc;
- char *argv[];
- {
- char command[255],title[255];
- int i,success;
- struct FileHandle *dfh;
- strcat(title,"CON:0/10/640/96/"); /* Crea la stringa title che */
- strcat(title,title1); /* definisce la finestra da */
- strcat(title,argv[1]); /* aprire. */
- dfh=Open(title,MODE_NEWFILE); /* Apre una finestra sul dos */
- if (argc==1)
- { /* Se non ci sono parametri */
- Write(dfh,msg1,strlen(msg1)); /* visualizza il messaggio */
- Write(dfh,msg2,strlen(msg2)); /* definito dai #define. */
- Write(dfh,msg3,strlen(msg3));
- Write(dfh,msg4,strlen(msg4));
- Write(dfh,msg5,strlen(msg5));
- Write(dfh,msg6,strlen(msg6));
- Write(dfh,msg7,strlen(msg7));
- Delay(200); /* Aspetta 4 secondi */
- Close(dfh); /* chiude la finestra */
- exit(10); /* e poi esce. */
- }
- i=1;
- while (i<argc)
- {
- strcat(command,argv[i]); /* Compone la stringa con i */
- strcat(command," "); /* comandi da passare alla */
- i++; /* funzione Execute. */
- }
- strcat(command,"\nendcli\n") ; /* Aggiunge un endcli per */
- /* far chiudere la finestra */
- /* a fine esecuzione. */
- success=Execute(command,dfh,dfh); /* Esegue i comandi presenti*/
- /* nella stringa command. */
- if (success==NULL)
- {
- Write(dfh,msgg1,strlen(msgg1)); /* Se Execute fallisce */
- Write(dfh,msgg2,strlen(msgg2)); /* da' un messaggio di */
- Delay(150); /* errore, chiude la */
- Close(dfh); /* la finestra e esce. */
- exit(20);
- }
- Delay(200); /* Ritardo di 4 secondi prima di chiudere la finestra */
- Close(dfh); /* Chiude la finestra */
- }
-
-
-