Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <locale.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <limits.h>
- int main()
- {
- setlocale(LC_ALL, "Portuguese, Brasil");
- int formandos, i, contrato;
- printf("Numero do Contrato:" );
- scanf("%d" ,&contrato);
- printf("Numero de Formandos(pastas):" );
- scanf("%d" ,&formandos);
- //método pra dar get no diretório atual (album)
- char* cwd;
- char buff[PATH_MAX + 1];
- cwd = getcwd( buff,PATH_MAX + 1 );
- //cria album da instituição e pastas extras
- snprintf(buf, sizeof(buf), "mkdir \"%d (0)\"",contrato);
- system(buf);
- system("mkdir \"Decoração\"");
- system("mkdir \"Descarte Geral\"");
- system("mkdir \"Fotos de Turma\"");
- //loop criação das pastas
- for ( i = 1;i <= formandos; i++){
- int i_formando = i;
- snprintf(buf, sizeof(buf), "mkdir \"%d (%d)\" && cd \"%d (%d)\" && mkdir Descarte ",contrato,i_formando, contrato, i_formando);
- system(buf);
- printf("Formando %d criado. ",i_formando);
- //vincula icones
- snprintf(buf, sizeof( buf), "cd %d (%d) && echo [.ShellClassInfo] >> desktop.ini && echo IconResource=%s\\Icones\\%d (%d).ico,0 >> desktop.ini && attrib +s +h +r desktop.ini && cd .. && attrib +s +r \"%d (%d)\" ",contrato,i_formando,cwd,contrato,i_formando,contrato,i_formando);
- system(buf);
- printf("Ícone Vinculado\n"); }
- //fim loop
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement