i tried to create dir under system32 folder but no exception shows or errors
note i run it as administrator
//1
if not TDirectory.Exists('C:\Windows\System32\oobe\info') then
TDirectory.CreateDirectory('C:\Windows\System32\oobe\info');
//2
if not DirectoryExists('C:\Windows\System32\oobe\info') then
CreateDir('C:\Windows\System32\oobe\info');
//3
try
ForceDirectories('C:\Windows\System32\oobe\info');
except
ShowMessage('cant create it');
end;
You have a 32 bit process on 64 bit Windows. Hence you are subject to the file system redirector. This redirects
system32
toSysWOW64
which is the 32 system directory. You'll find your directory there.You have these options:
sysnative
alias to access the 64 bit system directory.The final option here is fraught with danger and is not to be recommended.
The documentation gives the details: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187.aspx
Of course, it's plausible that writing to the 32 bit system directory is exactly what you want to be doing and you have not yet realised that.
And finally, it would be remiss of me not to point out that the system belongs to the system and should not be modified by applications.