>Hi ALL,
> I encountered two problems:
> 1. Use of macro substitution(&) at runtime produce an error while it is alright in command window:
> Copy file &fName to ....
> However, Copy file test.dbf to &fName WORKS
Rule #1 - don't use macro-expansion where it can be avoided, so that spaces and other characters that may be interpreted as separators by the command line parser don't hurt you. In the case above, name expansion avoids the problem quite neatly:
COPY (fname) TO ...
> 2. The use of FILE()fails to tell the existence of a file
> FILE(m_fname) returns FALSE at runtime
> while FILE(m_fname) return TRUE in command window
>
In all probability, the resolution of the path is inconsistent - FILE will return .T. if you use an unqualified path and it can be found anywhere along the current SET PATH setting. ADIR() seems to be less subject to wierdness, and the Scripting.FileSystemObject even less prone to error.