Re: run command

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I did this

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='cmd /K copy "c:\test\headerfile.txt" + ' + mfname + ' ' + mtargname

MESSAGEBOX(mcmd)

run &mcmd

The cj.txt was copied and the DOS window remained open. I typed exit in the DOS window to allow the FoxPro program to continue. cj2.txt flashed open a DOS windows but it didn't remain open and the file was not copied. ??????


Jan Bucek wrote:
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 . . .
.



Relevant Pages

  • Re: Defrag Automatic
    ... is the window which the cmd program opens. ... Leonard Grey ... a dos window opens and shows the analyze info and it onlys ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Doubleclick on Folder same window does not work
    ... Now I found the reason for the confusion: I tried to establish a command ... that opens a DOS window (for debugging CMDs) in the selcted folder. ...
    (microsoft.public.windowsxp.general)
  • Re: How do I setup Windows
    ... find how to open up a .tcl file correctly in Vista. ... - Next to "Opens With" ... basically a dos application, through the dos window. ... nvm, this page answered all of it. ...
    (comp.lang.tcl)
  • Re: GUI COMPILING
    ... But..it is very slow and when I run it, it opens ... first a dos window and next my gui. ... Can I avoid the dos window to ...
    (comp.soft-sys.matlab)