Solved

MS DOS

Posted on 1997-12-24
2
171 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MAPI Error1: User cancelled request ? 7 1,177
Real time Change DisplayName of service 7 616
How to use WebDispatcher to retrieve data 3 402
loading dll from external path 1 246
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 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