Having trouble working with a Windows\System32 Folder
Hello,
I have been working for two days trying to figure out what is my problem with copying files from the local C:\windows\system32\certsrv\certenroll folder to a UNC path.
My code working perfect if I use c:\source and c:\destination folders. But once I switch it to system32 I get this message from JIT
System.IO.DirectoryNotFoundException was unhandled
Message=Could not find a part of the path 'C:\Windows\System32\Certsrv\Certenroll'.
I disabled UAC on another server and still same issue.
So, one thing that I figure out is that a simple BrowseDialog box does not see all folders within system32 folder.
Code:
string sourcePath1 = @"C:\Windows\System32\CertSrv\CertEnroll";
string targetPath1 = @"\\testserver\certs\certenroll";
//Source Path 1 Operations
foreach (var sourceFilePath in Directory.GetFiles(sourcePath1))
{
string fileName = Path.GetFileName(sourceFilePath);
string destinationFilePath = Path.Combine(targetPath1, fileName);
System.IO.File.Copy(sourceFilePath, destinationFilePath, true);
//If we need to overwrite files, write an if else statement
//System.IO.File.Copy(sourceFilePath, destinationFilePath);
}
Has anyone come across this issue before.
I also attached a screenshot of it for your review.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.