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

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
 
J

John John (MVP)

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
 
T

Twayne

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.
 
L

LVTravel

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.
 
J

John John (MVP)

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
 
L

LVTravel

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.
 
T

tsgd84

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
 
J

John John (MVP)

What error message are you receiving when you try to delete the files?

John
 
R

Randem

T

tsgd84

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top