I wonder for the folder:

C:\\WINDOWS\\system32

What I try to do in C++ is to create and read a file from this folder by using this call to that specific folder.

System::Environment::GetFolderPath(Environment::SpecialFolder::System)

What my question is, is if this folder can be locked at some computers.
Is it a good idéa to create a file that will be needed by an application in this folder.
The whole purpose why I want to create a file in this folder is because I more easily can "hide" this file in this folder because there is so many files there rather than creating the file in the "Application Data" folder.

Thank you..

Why would you want to hide a file in the system directory anyway? I wouldn't consider saving a file there any more 'hidden' than in the application data folder. If you don't have much information to store, you could alternatively add it to a registry key, however that may not be an appropriate place depending on the kind of data you need to store.

The reason I want to "hide" the file is I am making a software that will need that file in order to work. (The purpose is to make the software more difficult to copy between computers).

The information to store would only be a few letters, not more.
The registry key might be a better/good idéa for this perheps ?

Thank you..

Why would you want to hide a file in the system directory anyway? I wouldn't consider saving a file there any more 'hidden' than in the application data folder. If you don't have much information to store, you could alternatively add it to a registry key, however that may not be an appropriate place depending on the kind of data you need to store.

post deleted

Writing to the registry isn't too difficult. With the help of google and msdn, it shouldn't be hard for you to figure out, but here's a couple of links.
Registry Function List
Registry Wrapper

Or, if you want to stick with making a file, you could think about saving the file with hidden attributes, though that may be hard to accomplish.

Hope this helps.

Great thanks, William Hemsworth

I think I will figure this out how to do... I think I will try the registry. It seems like a good idéa...
I might wonder if the call to the registry will be the same for all Windows operating systems from Windows 98 and higher...

Writing to the registry isn't too difficult. With the help of google and msdn, it shouldn't be hard for you to figure out, but here's a couple of links.
Registry Function List
Registry Wrapper

Or, if you want to stick with making a file, you could think about saving the file with hidden attributes, though that may be hard to accomplish.

Hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.