Solved

MS DOS

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now