Unable to delete files in "C:\Winnt\system32" folder

  • Thread starter Thread starter tsgd84
  • Start date Start date
T

tsgd84

Hi all,

I am trying to delete unwanted files from the system directory "C:
\Winnt\system32\" folder in Windows NT machine.

I tired using the functions

DeleteFile(LPTSTR lpFileName)

and

SHFILEOPSTRUCT sh;
sh.wFunc = FO_DELETE;
sh.pFrom=fileName;
SHFileOperation(&sh)

In both the cases, I cannot delete the file but the same function can
delete other files in other directories other than system32 folder

Any suggestions on this would be highly appreciated...

Thanx in advance
Deenad
 
Is the volume FAT or NTFS? If NTFS take a look at the permissions.
What error message are you receiving when you try to delete the files?
Using a tool like OH.exe might reveal useful information.

John
 
Hi all,
I am trying to delete unwanted files from the system directory "C:
\Winnt\system32\" folder in Windows NT machine.

I tired using the functions

DeleteFile(LPTSTR lpFileName)

and

SHFILEOPSTRUCT sh;
sh.wFunc = FO_DELETE;
sh.pFrom=fileName;
SHFileOperation(&sh)

In both the cases, I cannot delete the file but the same function can
delete other files in other directories other than system32 folder

Any suggestions on this would be highly appreciated...

Thanx in advance
Deenad

You probably don't have ownership of the files; check their permissions
& if necessary take ownership to manage them.
 
Twayne said:
You probably don't have ownership of the files; check their permissions &
if necessary take ownership to manage them.

They may also be protected system files in that folder. Most of the files
in that folder are part of the NT operating system. Deleting them may cause
the machine to give unpredictable results or totally crash.
 
LVTravel said:
They may also be protected system files in that folder. Most of the files
in that folder are part of the NT operating system. Deleting them may cause
the machine to give unpredictable results or totally crash.

There is no WFP in NT4.

John
 
John John (MVP) said:
There is no WFP in NT4.

John

I agree but deleting out of that folder is just asking for trouble with the
install unless the OP really knows what he is deleting. Just trying to head
off issues.
 
Thanks for all your help.

I have checked the permission of those files.
The file have "Full Control" for administrator user
I am running the application as administrator user.

Thanks
Deenad
 
Thnaks for all your suggestions.
I believe that those files were used by some other services.
Once I found and stopped those services, the issue is resolved.

Thanx
Deenad
 
Back
Top