Advertisement
cgrunwald

a931bw

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