I have created a batch file that copies some dll files into System32 folder. I ran this batch from my program written in C# code:
string path = @"ABC\install.bat";
ProcessStartInfo procStartInfo = new ProcessStartInfo()
{
UseShellExecute = true,
CreateNoWindow = false,
FileName = "\"" + path + "\"",
//Arguments = "\"" + path + "\""
Verb = "runas"
};
using (Process proc = new Process())
{
proc.StartInfo = procStartInfo;
proc.Start();
}
Everything has worked fine. I got the popup message to confirm the change from Windows 7. The console also proved that the file had been copied:
C:\Program Files\XXX>copy commpro.dll C:\Windows\system32\
1 file(s) copied.
But when I look in System32 folder I couldn't find my dlls there. It's so strange!
Does anybody occur this issue?
Edit: My question is different with this question: How to write files in C:\Windows\System32 with full permissions
Here I got the popup that allow me to grant permission to write to System32 folder. And the output of "copy" command didn't show "Access Denied" but "Copied". The problem is why it doesn't contain my dlls while it said "copied" ?