how to create file under "system32"?

F

Fall

My questions:
1. is it possible to create new files under "SYSTEM32" in runtime of an
user's application?
2. after the file creation, where to find it?
 
M

Mr. Arnold

Fall said:
My questions:
1. is it possible to create new files under "SYSTEM32" in runtime of an
user's application?

The only way that will happen is the application is running with Run As
Administered privileges,when it's saving the file.
2. after the file creation, where to find it?

If you have to ask this question, then maybe you shouldn't be doing it.
 
F

Fall

Thanks for your answers.
In fact, I use the code below to create file under "SYSTEM32"
ofstream myNewFile;
myNewFile.open("c:\windows\system32\newfile.txt");
myNewFile<<"this is a new file.";
myNewFile.flush();
myNewFile.close();
After running these steps, I can not find the "newfile.txt" under SYSTEM32.

But, when I use the code below to read the file, I can get the content of it:
ifstream ifs;
ifs.open("c:\windows\system32\newfile.txt");
//get data from file
ifs>>m_cBufData;

Where is the file I created?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top