MS DOS

How can I use for instance the dos command format c: in a pascal prg?
MeNaCeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
omsecConnect With a Mentor Commented:
Hi ya there !!

Executing Dos - Command is easy !!

Program DosCMD;

{$M 8192,0,0}

Uses
  Crt, Dos;

Var
  Command : String;

Begin
  ClrScr;
  Command := 'dir';
  Command := '/c' + Command;
  SwapVectors;
  Exec(GetEnv('Comspec'), Command);
  SwapVectors;
  Readln;
End.  
 
Greets, Omsec
0
 
OdieCommented:
SwapVectors;
Exec('format', 'c:');
SwapVectors;

I think it was like this.
0
All Courses

From novice to tech pro — start learning today.