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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COPY TO with long dir names? 1

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
0
0
US
Hey there folks--

i'm trying to do the following:

Code:
gcHomeDirectory = JUSTPATH(SYS(16,0))
SET DEFAULT TO (gcHomeDirectory)

gcAppName = GETFILE("EXE","","",0,"Select Application")
lcName = JUSTFNAME(gcAppName)

COPY FILE &gcAppName TO &lcName

this works fine unless the directory name contains a space(s) (like "C:\Program Files\...").. then i get a "command contains unrecognized command/keyword..." error.. i've also tried

COPY FILE "'"+&gcAppName+"'" TO "'"+&lcName+"'"

and inserting single quotes into gcappname directly, everything gives the same error.

where am i off? any thoughts?

thanks
--frank~
 
Hi Frank,

Try this:
gcHomeDirectory = JUSTPATH(SYS(16,0))
SET DEFAULT TO (gcHomeDirectory)

gcAppName = GETFILE("EXE","","",0,"Select Application")
lcName = JUSTFNAME(gcAppName)
gcAppName = "'" + gcAppName + "'"

COPY FILE &gcAppName TO &lcName


Goodluck,
Adrian.
 
Forego the macro substitution and do the following:

COPY FILE (gcAppName) TO (lcName)


boyd.gif

 
DOH!! i could've sworn that i tried that along the way.. guess not.. but it works.. thanks craig.

-- frank~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top