0

Hello,

I am so frustrated as I search the internet and cannot find solution for what I want to do...

I want my C or C++ code be able to create a file in a directory under "C:\Program Files", for example "C:\Program Files\abc\xyz.txt". This usually triggers a security confirmation like "You need to provide administrator permission..." when you do it manually on Windows vista/7. I don't mind if this attempt requires a confirmation from user to continue.

I've tried FileIOPermission with no luck. Please help me if you know the resolution. Thank you very much

Linx

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by linx_mt
0

Code please? We can't really help much without seeing your attempt at it.

N.B.: I hope you are aware that in C/C++ you cannot write a file-path as "C:\Program Files\my\path\file.txt", because the slash "\" character is an escape character. To actually get the "\" character, you need to write "\\" instead, as so: "C:\\Program Files\\my\\path\\file.txt".

0

I need to create a license file (text file) in the same directory (C:\Program Files\VendorName\SoftwareName\SoftwareName.lic") as the executable. The license file will be created only once the first time user launch the program.

Because the license file is supposed to be shared among multiple users on the computer, it makes sense to make it sit in a "centralized" directory.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.