Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program A931bw; //self explainory
- uses dos,crt;
- var //variables
- Shell,s,aa:string;
- a,f: Text;
- begin
- clrscr;
- Shell := GetEnv ('COMSPEC'); //i have no idea what this does
- Exec (Shell, '/C cls'); //execute shell(cmd)
- Exec (Shell, '/C cd "/"');
- Exec (Shell, '/C dir > Files.txt'); //f:files.txt
- Assign(f,'Files.txt'); //reset F
- Reset(f); // Cicle of reading
- while not eof(f) do
- begin
- Readln(f,s);
- WriteLn(s);
- end;
- writeln('Add or Remove subdirectory? a , r');
- readln(a);
- if a = 'a' then
- WriteLn('Enter Folder name to create!'); //Write new line TEXT
- Readln (aa); // Read variable aa value
- {$I-} { Don't Abort program on error } // IO test
- MKdir (aa); //make new dir called
- begin
- if IOResult <> 0 then //Error check
- Writeln ('Error')
- else
- Writeln('done');
- end
- @h@ else
- WriteLn('Enter Folder name to create!'); //Write new line TEXT
- Readln (aa); // Read variable aa value
- {$I-} { Don't Abort program on error } // IO test
- MKdir (aa); //make new dir called
- begin
- if IOResult <> 0 then //Error check
- Writeln ('Error')
- else
- Writeln('done');
- end
- Readln(aa); //pause
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement