How do I define the pathname to a file in WIndows 10
Kenneth Brody
kenbrody at spamcop.net
Tue Dec 8 06:56:12 PST 2015
On 12/8/2015 6:04 AM, Brian K. White via Filepro-list wrote:
> On 12/7/2015 11:57 AM, John Hemmer via Filepro-list wrote:
>> Hi,
>> I am trying to redirect a report so that it appear as a text file on my
>> laptop.
>> I am have trouble in windows 10 because it does not seem to work like
>> olderversion of windows, like windows 7.
>> Help?
[...]
> I think you are going to want to use the system variables to point to the
> users My Documents directory, without hard coding any assumptions about
> where that actually is. Otherwise you will always run into permissions
> problems not being able to write to dirs you used to be able to.
>
> %USERPROFILE%\My Documents\foo.txt
>
> Which would probably look like this in a filepro prc table (I'm not using
> windows filepro so I can't double-check it):
>
> x = chr("92")
> tf = getenv("USERPROFILE"){x{"My Documents"{x{"foo.txt"
>
> or add quotes around the whole string because of the space in My Documents:
>
> tf = "\""getenv("USERPROFILE"){x{"My Documents"{x{"foo.txt\""
Well, he still hasn't told us what he did, or what problems he ran into
doing that, so we're still just guessing.
However, I should note that, unless you are passing the filename to a SYSTEM
command which doesn't allow "/" in filenames, you can just use "/" instead.
For example:
tf = getenv("USERPROFILE") { "/My Documents/foo.txt"
Note, too, that USERPROFILE includes the drive letter, so prefacing it with
a slash will cause it to fail as a filename.
--
Kenneth Brody
More information about the Filepro-list
mailing list