Advertisement
cgrunwald

Untitled

Oct 1st, 2010
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.97 KB | None | 0 0
  1. program A931bw;       //self explainory
  2. uses dos,crt;
  3. var                                      //variables
  4. Shell,s,aa:string;
  5.   f: Text;
  6.  
  7. begin
  8. clrscr;
  9.  
  10. Shell := GetEnv ('COMSPEC');           //i have no idea what this does
  11.  Exec (Shell, '/C cls');              //execute shell(cmd)
  12.   Exec (Shell, '/C dir > Files.txt'); //f:files.txt
  13.   Assign(f,'Files.txt');              //reset F
  14.     Reset(f);                         // Cicle of reading
  15.    while not eof(f) do
  16.    begin
  17.       Readln(f,s);
  18.       WriteLn(s);
  19.    end;
  20.   WriteLn('Enter Folder name to create!');        //Write new line TEXT
  21.   Readln (aa);                                // Read variable aa value
  22.   {$I-}   { Don't Abort program on error }      // IO test
  23.   MKdir (aa);                                 //make new dir called
  24.   if IOResult <> 0 then                       //Error check
  25.     Writeln ('Error')
  26.   else
  27.        Writeln('done');
  28.  
  29.   Readln(aa);                                 //pause
  30.   end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement