Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative for System( ) 2

Status
Not open for further replies.

classic773

Programmer
Jun 14, 2001
57
US
Currently I'm using the System function as follows:
system("del seqfile.txt");
system("move seqfile2.txt seqfile.txt");
system(&quot;seq_in_pts avgund.tif post_img.tif < seqfile.txt&quot;);

However, I would prefer not to have the Command Prompt windows appear. I've tried ShellExecute and WinExec, and neither of them seem to be able to carry out the command. Does anybody have any suggestions?

(seq_in_pts is an .exe)
 
Hi

I think the following will work

DeleteFile(&quot;seqfile.txt&quot;);

To move the file you could read it using CFile then write it to the new location and delete the old file.

Take a look at the CreateProcess function to see about executing a file.

I think the above would work.
 
see also functions MoveFile(&quot;path1&quot;,&quot;path2&quot;); and
CopyFile(&quot;path1&quot;,&quot;path2&quot;,boolToDeleteExisting) John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top