Re: run command



use "cmd /C COPY ..... " in your string
or
"cmd /K COPY ... " to force the command window to wait and show the results




cj napsal(a):
This command works fine from the dos prompt

copy "c:\test\headerfile.txt" + "c:\test\from dir\cj.txt" "c:\test\from dir\to dir\cj.txt"

Why doesn't this work in VFP 8?

dimension inbarray[2]
inbarray[1]="cj.txt"
inbarray[2]="cj2.txt"

mfname='"c:\test\from dir\'+inbarray[i,1]+'"'
mtargname='"c:\test\from dir\to dir\'+inbarray[i,1]+'"'

mcmd='copy "c:\test\headerfile.txt" + ' + mfname + ' ' + mtargname

MESSAGEBOX(mcmd)

run &mcmd

The dos screen goes so quick I can't see what it says if anything. So, I then tried this.

mcmd ='pause'
run &mcmd

It works. Dos window opens with
C:\test>pause
Press any key to continue . . .
.