>TO needs a file name, not just a path.
No. It's not documented, but this works:
Code:
If !Directory("D:\temp")
MkDir D:\temp
EndIf
Copy File Home()+"BUILDER.APP" to d:\temp
The help says both Filename1 and Filename2 must contain file extensions, which indicates you also need a destination file name, true. But you can also use joker chars as ? and *, The help gives the example COPY FILE *.PRG TO *.BAK, which indicates some automatism on keeping the file name for the destination folder, if it's provided partially only, as in *.BAK and specifying a destination path only, the full source file name is taken for the copied file name.
What indeed causes an error even though D:\temp is not a secured folder is
Code:
Copy File Home()+"BUILDER.APP" to d:\temp\
What works again of course is
Code:
Copy File Home()+"BUILDER.APP" to d:\temp\builder.app
In the end I agree using ADDBS() is always a good thing, in this case you would rather need REMOVEBS, which doesn't exists. Instead you use Justpath, as Justpath removes a trailing backslash, but it also removes a folder name, if there is no trailung backslash. So you need to add an eventually missing backslash first, and then remove it: Justpath(Addbs(GetEnv("Windir"))), but you'd still not write there without being privileged, even as admin user, you need process elevation additional to being an admin, that's UAC security.
Bye, Olaf.