Solved

MS DOS

Posted on 1997-12-24
2
170 Views
Last Modified: 2010-04-16
How can I use for instance the dos command format c: in a pascal prg?
0
Comment
Question by:MeNaCe
2 Comments
 
LVL 1

Expert Comment

by:Odie
ID: 1217022
SwapVectors;
Exec('format', 'c:');
SwapVectors;

I think it was like this.
0
 
LVL 2

Accepted Solution

by:
omsec earned 50 total points
ID: 1217023
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

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An article on effective troubleshooting
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question