|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int wahl;
char Zeile[900];
FILE *f;
if(argc==2) {
printf("Font %s Installieren?",argv[1]);
scanf("%d",&wahl);
switch(wahl) {
case 1:
printf("test");
break;
case 2:
printf("test 2");
break;
default:
printf("Es ist ein fehler aufgetreten");
break;
}
}
getchar();
return 0;
}
|
This post has been edited 1 times, last edit by "Helvete" (Sep 29th 2010, 3:16pm)
This post has been edited 2 times, last edit by "Helvete" (Sep 29th 2010, 9:22pm)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(int argc, char *argv[])
{
int wahl;
char pfad[]={"C:\\test"};
char weg[900];
char suche = '\\';
char* ergebnis;
ergebnis = strrchr(argv[1],suche);
if(argc==2) {
printf("Soll %s installiert werden?\n\n", ergebnis);
scanf("%d",&wahl);
switch(wahl) {
case 1:
printf("Programmstart\n");
strcat(weg,pfad);
strcat(weg,ergebnis);
printf("\n%s\n",argv[1]);
printf("%s",weg);
CopyFile(argv[1],weg,FALSE);
getchar();
break;
case 2:
printf("Script wird beendet");
int i;
for(i=0;i<=6;i++) {
printf(".");
sleep(500);
}
if(i==6) {
exit;
}
default:
printf("Es wurde nichts ausgesucht Programm wird beendet!");
getchar();
break;
}
}
getchar();
return 0;
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(int argc, char *argv[])
{
int wahl;
char pfad[]={"C:\\test"};
char weg[900];
char suche = '\\';
char sonderen = 'C';
char* ergebnis;
char* weg2;
ergebnis = strrchr(argv[1],suche);
if(argc==2) {
printf("Soll %s installiert werden?\n\n", ergebnis);
scanf("%d",&wahl);
switch(wahl) {
case 1:
printf("Programmstart\n");
strcat(weg,pfad);
strcat(weg,ergebnis);
printf("\n%s\n",argv[1]);
printf("%s",weg);
weg2 = strrchr(weg,sonderen);
printf("\n%s",weg2);
CopyFile(argv[1],weg2,FALSE);
getchar();
break;
case 2:
printf("Programm wird beendet");
int i;
for(i=0;i<=6;i++) {
printf(".");
sleep(500);
}
if(i==6) {
exit;
}
default:
printf("Es wurde nichts ausgesucht Programm wird beendet!");
getchar();
break;
}
}
getchar();
return 0;
}
|
This post has been edited 1 times, last edit by "Helvete" (Sep 29th 2010, 10:20pm)