Board index » delphi » Help with c:/con/con HELP!!! PLEASE

Help with c:/con/con HELP!!! PLEASE

can any body tell me a code i could rite which redirects or executes or
somtin with c:/con/con
i want to know how i would rite a code which redirects to a directory or
somthing for example
lets say i had a prorgam in c:\hi\hi.exe

and i want to rite a prorgam which executes c:\hi\hi.exe how would i do that
program please help

 

Re:Help with c:/con/con HELP!!! PLEASE


Hi,

Quote
trip wrote:
> can any body tell me a code i could rite which redirects or executes or
> somtin with c:/con/con
> i want to know how i would rite a code which redirects to a directory or
> somthing for example
> lets say i had a prorgam in c:\hi\hi.exe

It is a little bit unclear to me what exactly you want to do. Try
posting in your mother language if you have problems with English -
there is a good chance that someone else on this forum will at least
be able to translate it.

To execute a program, use the Exec procedure. Example:

   SwapVactors;
   Exec('c:\hi\hi.exe', '');
   SwapVectors;

See the online help for more information on Exec. You can also execute
the command interpreter, command.com (the exact path to this program
should be determined by evaluating GetEnv('COMSPEC')). Then you can
issue normal DOS commands, redirection and all. E.g. (untested):

   Exec(GetEnv('COMSPEC'), '/c dir > list.txt');

HTH,

 - Sebastian

--
Add "NOSPAM" to my email to send me junk!

Re:Help with c:/con/con HELP!!! PLEASE


Re:Help with c:/con/con HELP!!! PLEASE


Hi,

U?ytkownik Sebastian Koppehel <un0...@bastisoft.de> w wiadomooci do grup
dyskusyjnych napisa3:ibtef8.ec...@bastisoft.de...

Quote
> Hi,

> trip wrote:

> > can any body tell me a code i could rite which redirects or executes or
> > somtin with c:/con/con
> > i want to know how i would rite a code which redirects to a directory or
> > somthing for example
> > lets say i had a prorgam in c:\hi\hi.exe

> It is a little bit unclear to me what exactly you want to do. Try
> posting in your mother language if you have problems with English -
> there is a good chance that someone else on this forum will at least
> be able to translate it.

> To execute a program, use the Exec procedure. Example:

>    SwapVactors;
>    Exec('c:\hi\hi.exe', '');
>    SwapVectors;

> See the online help for more information on Exec. You can also execute
> the command interpreter, command.com (the exact path to this program
> should be determined by evaluating GetEnv('COMSPEC')). Then you can
> issue normal DOS commands, redirection and all. E.g. (untested):

>    Exec(GetEnv('COMSPEC'), '/c dir > list.txt');

> HTH,

>  - Sebastian

> --
> Add "NOSPAM" to my email to send me junk!

Yeah, u can even do sth like this:
Exec(GetEnv('COMSPEC'),'/c c:\hi\hi.exe');

More, to write your own simple console:
repeat
Readln(command);
Exec(GetEnv('COMSPEC'),'/c '+command);
until command='exit';

This is gonna work both with external applications and DOS internal
commands.

Re:Help with c:/con/con HELP!!! PLEASE


Re:Help with c:/con/con HELP!!! PLEASE


On Thu, 11 May 2000 19:00:24 +0200, "trip" <odys...@mercuryin.es>
wrote:

Quote
>can any body tell me a code i could rite which redirects or executes or
>somtin with c:/con/con

That's not a legal filename.  CON is a reserved word, the name of a
character device.

ras...@highfiber.com

Re:Help with c:/con/con HELP!!! PLEASE


Quote
trip wrote in message <8fepp3$iu...@diana.bcn.ttd.net>...
>can any body tell me a code i could rite which redirects or executes or
>somtin with c:/con/con
>i want to know how i would rite a code which redirects to a directory or
>somthing for example
>lets say i had a prorgam in c:\hi\hi.exe

>and i want to rite a prorgam which executes c:\hi\hi.exe how would i do
that
>program please help

swapvectors;
exec('c:\hi\hi.exe','');
swapvectors;

Would work.

To change current directory us the function chdir('new directory').

To find all the sub-directories use the file search.
use:
var
 dirinfo:Searchrec;

 findfirst('*.*',Directory,dirinfo)

Use your TP help to get the rest.

Chaou
Heinrich

Check my web-site:
http://homes.arealcity.com/Heinrichshomepage/
Includes a complete TP tutoriul and more!

Other Threads