How can I have access to System32 directory to copy files?

ypd11

Member
Joined
Dec 31, 2022
Messages
7
Location
Cuba
Programming Experience
Beginner
I'm developing a WinForms app and I need to gain access to the system32 folder in Windows but when the app tries to writes some files there it throws the Access denied exception. Do any one of you guys have a solution for this issue? Or is there even a solution?
 
You don't need to write into the System32 directory to use WinForms.

Did you mean to say that your code is trying to write to the System32 directory, and as aside you happen to be using WinForms for your UI?

You would have the same problem regardless of UI framework or language. You basically need admin privileges to write into the System32 directory of most modern versions of Windows.

Why do you even need to write into the System32 directory?
 
You don't need to write into the System32 directory to use WinForms.

Did you mean to say that your code is trying to write to the System32 directory, and as aside you happen to be using WinForms for your UI?

You would have the same problem regardless of UI framework or language. You basically need admin privileges to write into the System32 directory of most modern versions of Windows.

Why do you even need to write into the System32 directory?
Yes, I'm using Windows Forms. I need to write some files into the System32 folder because I'm creating a Windows LTSC Evaluation activator and the activation requires to write those files into that folder. I created a new manifest file and set it to requireAdministrator but it won't work either, and if I tried to right-click on the executable and click Run as administrator I would get the same exception. Thanks anyway for your reply.
 
But to do the LTSC evaluation, all that need to be done is to download an ISO. There is still no need to write to the System32 directory. Is what you are doing even legal?

Update: Looks like Cuba is still in the list for MS products being barred:
 
Last edited:
But to do the LTSC evaluation, all that need to be done is to download an ISO. There is still no need to write to the System32 directory. Is what you are doing even legal?

Update: Looks like Cuba is still in the list for MS products being barred:
All I'm trying to do is an activator for my Windows installation. I always use this ISO because it has been the best one running on my laptop so I wanna have my own activator. I do have the ISO and the system is installed already, I'm just trying to activate it, but I would lke to code a program to do so. Just to learn a little more...
 
A batch file also cannot write into the System32 directory without running with admin privileges.
 
A batch file also cannot write into the System32 directory without running with admin privileges.
No, the batch file i found is not intended to write to sytem32. It just installs the activation key and activates windows. Its just those you find online.
 
So why can't you just execute the commands that are in the batch file from within your program? Why do you need to copy files into the System32 directory? Also, even if you have admin privileges, if you are trying to replace (instead of just copy new files) into the System32 directory, that requires an even higher level of privilege due to the file protection system that Windows has added on for the sake of security, as well as, to mitigate the DLL Hell of the 90's.
 
So why can't you just execute the commands that are in the batch file from within your program? Why do you need to copy files into the System32 directory? Also, even if you have admin privileges, if you are trying to replace (instead of just copy new files) into the System32 directory, that requires an even higher level of privilege due to the file protection system that Windows has added on for the sake of security, as well as, to mitigate the DLL Hell of the 90's.
That is exactly what I meant to say on my last reply, just execute the commands.
 

Latest posts

Back
Top Bottom