Normal Topic Need to write a file to local users folder (Read 562 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Need to write a file to local users folder
Dec 21st, 2010 at 7:55pm
Print Post Print Post  
I'm trying to get sesame to print to a pdf printer instead of paper. The software I'm using is called bioPDF and it requires that a 'runonce.ini' file be written to the users local APP folder just prior to printing.

In sesame, client/server confi I am trying this line, but it's not writing anything:

Fileoverwrite("%LocalAppData%\Temp\Test.txt", "Test message")

However, this works fine:
Fileoverwrite("C:\Users\Steve\AppData\Local\Temp\Test.txt", "Test message")

Is this a proper way for sesame to access the User's local Apps folder?

Thanks,
Steve




  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Need to write a file to local users folder
Reply #1 - Dec 21st, 2010 at 8:10pm
Print Post Print Post  
Hello Steve,

Try

Code
Select All
Var vAppDataPath as String

vAppDataPath = @GetLocalEnvVar("LocalAppData")
Fileoverwrite(vAppDataPath + "\Temp\Test.txt", "Test message")
 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Need to write a file to local users folder
Reply #2 - Dec 21st, 2010 at 8:37pm
Print Post Print Post  
Worked like a charm! Thanks Ray.
  
Back to top
IP Logged