1. David Haas
  2. PowerBuilder
  3. Thursday, 30 January 2020 19:46 PM UTC

Hi all!

In an app I have on WIN7,  I call the following to update a datetime stamp in an INI file and it works fine.

      SetProfileString('monitor_ini', "computername", "lastrun", ls_str_datetime)

The INI file is located in the same directory as EXE

      C:\Program Files\ACME, Inc\ACME Monitor\monitor.ini

On WIN10, when I call the SetProfileString, the INI that gets updated is not the one directly above.  Instead it updates the one in the following location:

      C:\Users\STATUS\AppData\Local\VirtualStore\Program Files\ACME, Inc\ACME Monitor\monitor.ini

I don't know why this version of the file is being created/updated instead but it is causing issues with other apps that read the datetime stamp in C:\Program Files\ACME, Inc\ACME Monitor\monitor.ini.

Any thoughts and/or suggestions would be greatly appreciated!!!!

Thanks, Dave

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 31 January 2020 04:31 AM UTC
  2. PowerBuilder
  3. # 1

Tried specifying the full path to monitor.ini, when doing the SetProfileString() ?

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 30 January 2020 20:11 PM UTC
  2. PowerBuilder
  3. # 2

Because 'Program Files' is a protected area. The .ini file should be in the Documents folder instead.

Also, 'Program Files' is supposed to be for 64bit apps. 32bit apps are supposed to use 'Program Files (x86)' although the OS doesn't enforce that.

Comment
  1. mike S
  2. Thursday, 30 January 2020 20:45 PM UTC
ProgramData probably makes more sense than documents folder

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 31 January 2020 17:00 PM UTC
Roland is correct. Unless your running your App(s) with ADMIN privileges, writing anything back to the 'Program Files' (32 or 64 bit folder) is a No, no under W10.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.