How to Delete a System File in Windows Vista
Warning: Do not delete system files. Bad things will probably ensue.
If you need to delete or overwrite a system file in Windows Vista, you’ll quickly notice that you cannot delete system files, even as administrator. This is because Windows Vista’s system files are owned by the TrustedInstaller service by default, and Windows File Protection will keep them from being overwritten.
Thankfully, there’s a way that you can get around this. You need to take ownership of the files, and then assign yourself rights to delete or modify the file. For this, we’ll use the command line.
Open an administrator command prompt by typing cmd into the start menu search box, and hit the Ctrl+Shift+Enter key combination.

To take ownership of the file, you’ll need to use the takeown command. Here’s an example:
takeown /f C:\Windows\System32\en-US\winload.exe.mui
That will give you ownership of the file, but you still have no rights to delete it. Now you can run the cacls command to give yourself full control rights to the file:
cacls C:\Windows\System32\en-US\winload.exe.mui /G geek:F
Note that my username is geek, so you will substitute your username there.
At this point, you should be able to delete the file. If you still can’t do so, you may need to reboot into Safe Mode and try it again. For the filename in the example, I was able to overwrite it without safe mode, but your mileage may vary.
Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:
| Similar Articles | Featured Wiki Articles |
| Latest Software Reviews | Quick Linux Tips |
| Geek Arcade | Popular Forum Threads |


Works Great Thx!!!
This actually works and it’s good because the onscreen keyboard was being gay and always turning on, on a boot up. Not anymore.
Thanx
Thanks for the tip for deleting system32 files. I almost got frustrated with the idea of having to install Vista for the 3rd time in a span of 6 hours… Thanks a lot. It works.
How do you delete a directory or several files? The reason I asked this is, I installed vista two time on my laptop. The first was in a small partition and the second in the larger one. Now I need to delete the windows and system files from the small partition to free up space
Thanks for the tips I am trying to do the same as Iwatson. This works great:
cacls “Program Files” /T /G Administrator:F
cacls “Windows” /T /G Administrator:F
cacls “Users” /T /G Administrator:F
ok, this seemed complicated since i wanted to delete many system files from a previous Vista install on a secondary partition that i was cleaning up. i didn’t want to reformat, so i tried delete and ran into this brick wall.
the solution that i find much easier for multiple files is the following:
(assuming you CAN use admin privs) 1)via folder properties go to your security tab.
2) in the bottom half you have the permissions listed for users, click the Advanced button
3) now go to the Owner tab, click Edit button (you will be asked for permision if UAC is at default)
4) change owner to your account and be sure to check the ‘Replace owner on subcontainers and objects’ and click Apply button. this results in all files including system files being switched to your account as owner!
5)now in the ‘Advanced Security Settings for (your folder)’ you need to edit the permissions: select your account (the one you just used to take ownership) and click Edit button.
6) you now see the Permissions tab and you need to again select your user account. (ensure that the permission is Full Control) check the lower ‘Replace all existing inheritable permissions…’ box and click Apply.
You are done! now you can close all the property stuff and just delete your folder. it may still ask for permission, but you now have the needed permissions to delete all contents of the folder.
hope this solves the problem for anyone that needs to take care of multiple files, obviously it will work for a single file as well.
You rock. I’ve had issues with some documents from an earlier (Beta) version of Vista. I could not read them after I reinstalled with my Ultimate (64-bit) version due to file access restrictions that couldn’t be fixed with the normal menu-based ownership dialogs.
Thank you very much
you do rock! i’ve been having print spooler issues and needed to replace the localspl.dll file but could not do it by takeown alone, but adding the calcsc command, all is good and i’m a very happy man. thanks!
I couldn’t get this to work at first because the command prompt told my i didn’t have permission to give myself permission (or something like that). If this happens to you, right click the command prompt icon and select “Run as Administrator”
Great!
Thanks alot!
Thanks for the tips.
Thanks for the nice trick.
I had a bootmgr file on the wrong hd, because I tried to boot after forgetting to connect the boot-hd while fixing something. After reconnecting the pc tried to boot from the wrong hd, wich had no os and a error occured. A rather stuborn problem, wich is now fixed.
Teddy
I will do anything for you. I have been browsing around forums after forums for answers, and TAKEOWN has to be the best.
Installed and, because it doesn’t work in Vista, uninstalled Nero 7. Left with 4 dlls in Nero Backitup folder. Nothing I did, including all of the above, would allow me to delete them. Eventually removed all references to them in the Registry, rebooted, again logged on as Administrator and then was able to delete them.
Because of backwards compatibilty problems, it looks like it’s going to be a long time before I’d recommend anyone upgrading to Vista, especially from XP Pro.
Thanks
Peter
Ok Guys…..I really screwed up.(that’s what usually happens when you don’t know what your doing) I was trying to gain access to my entire drive so I could delete temp files/temp internet files etc. So, after reading this post on how to delete system files I used this in the command prompt: [takeown / C:\ f ] afterwhich it said that my-acer had owership….Cool so far….I think. Then I used the cacls command: [cacls C:\ *.* /G my-acer:F] I was asked if I was sure & answered yes,hit return & it said the process was successful. Now I can’t get many things to run at all & if I attempt to use the command line as an admin I get this:”c:\windows\system32\cmd.exe the parameter is incorrect”. I get the same sort of message when I try & run other things. I have to also say that when I login to start windows my name is “ironhorse” & the name of the pc is “my-acer”. A friend told me I need to give full rights to both of these names if I want to delete certain files as their considered administrators(both me of course). I haven’t restarted the machine cause I know it will never restart so I’m trying to get this fixed through the command prompt. I tyred to roll back through system protection but can’t get there either. Am I screwed or is this fixable. I really need the help Big Time,Mike
For deleting folders in Vista (I did the whole of Program Files):
M:\>icacls “m:\program files” /grant martin:(D,WDAC) /t
martin is my user name. This grants delete and write rights to all folders, files and sub-folders in Program Files. No need to bother with takeowner as this seems to replace both it and cacls.
Thanks a LOT for the original tip geek. Very helpful as I had a lot of wasted space on an old system drive which I have started using as a slave.
u can use
“takeown /f C:\*”
and
“cacls C:\* /G USERNAME_HERE:F”
so u only need to use the command once
At the command prompt this is what I see: C:\Users\user
Anything I type brings this response: ERROR: Access is denied.
This is what needs to be overcome “First”. Sorry, I should have made that clear. Mike
PS: Thanks for the tips regardless as I may be using these in the future.
As there is no appearent answer to this question, what I think I’ll do
is wipe the drive & reinstall a clean copy of vista and stay away of
the command line in the future untill I gain more knowledge.
Thanks to all for the suggestions. Mike
You don’t need to! All the steps are above.
Press the Start button. Negotiate to the command prompt but don’t click on it. Instead right click on it and Run as Administrator. Now type this:
M:\>icacls “m:\program files” /grant martin:(D,WDAC) /t
replacing M:\ with your drive letter and martin with your own user name. If your user name has any spaces put it in quotes like the “program files” is here.
In XP use cacls instead.
Q: I have a big issue with a file that is stuck in my emule incoming file which is a movie that downloaded completely.I cannot play it so I decided to delete it.Bummer…..when I click on it my computer seems to freeze up.HOW do I delete this file in CMD running windows vista?????
PLS a step by step explanation would be nice. THNX dwlejuez
as a response to wills post i tryed that with a folder on my hdd called system volume information but it told me acces is denied???? i tryed every other option and this one has worked the best so far until it said acces is denied
Anybody have any answers?
I purchased My computer and they mistakenly used My sister’s name on the registration I believe (she did the buying for Me.) Anyway, now I have a user\Najee that doesn’t seem to really exist except if I’m doing downloads or if I go to users folder when I access it from Computers in the Start menu. Funny thing is I’m the administrator but in the Computer\Os\User folder, I don’t exist. Just public and Najee. How do I get My account listed in users? How do I get rid of Najee in the list(love her but don’t want My files named with her name)? Once again I repeat, when I go to Manage User Accounts, Najee doesn’t show up.
Just as an update to this, you can use the wonderful freeware program called “Unlocker”, located here. Just right click the file in question, click the “Unlocker” option in the context menu, then highlight any programs using the file and click Unlock or Unlock All at the bottom of the window, you should then be able to delete the file.
I used this program a lot with WinXP and an so happy to have just learned it was Vista compatible as well.
You might need to go ahead and do the Take Ownership step above, I have the registry tweaks added that give me an option in the context menu for this and did that first.
rd /s deletes all files and subfolders regardless of permission. I use the rd with 4nt but the cmd rd should perform the same.
I tried deleting the file d3d8.dll.
The TAKEOWN worked properly, but the cacls after pressing enter to get full control this is what it says : “No mapping between account names and security ID’s was done.”
I was having trouble using these commands to delete programs such as Windows Mail and Windows Sidebar etc. Can anyone help me out with the path to these files? Thanks so much
I was having a big trouble in using these commands to delete programs such as Windows Vista in my own computer. And i recieved help from this web site, my problem is now solved.Thanks and regards. From South Africa, Johannesburg
How to undo this process after I’m finished deleting?
Hi I deleted W. Defender but how can I delete Icon in control panel?
HELP!!!!!!!
I took control of my entire C: drive, and changed only one .dll in the system 32 folder. Now my computer is crazy, and doesn’t have access to anything. I can’t even run the system restore to undo what I did. How do I un-own what I took ownership of? Do I just do the same thing as above but say TrustedInstaller instead of my user name???
I wouldn’t delete the Sidebar and Windows Mail. Just disable the services if you don’t want them.
Wich dll did you change Doug?
how do i delete the file named AVG7QT.DAT in command prompt??
i got that from AVG. i don’t know how to use the command prompt. can you please help me!!!
Hi i dont really under stand how to do this as im only a kid.
Could some one tell me the exsact code to delete all the windows sidebar files on vista thanks
Somebody please help, the first part was a sucess but after i do the ”cacls C:\Windows\System32\en-US\winload.exe.mui /G geek:F” part it says Cacles is now deprecated please use Icacls.. and this it has around 15 line of some next thing…
when i try and take ownership of the file, it comes up with the error bthat the file can’t be found. anyway of deleting a .lnk shortcut when it isnt actually there!!
thanks for the tips im going to go home and try it…. but knowing vista it will have some kind of crap attack at me cant say im very impressed with vista the concept behind some of its features is well intended but UAC?? if thats not the devils work i dont know what is all i want to do is replace one script that i probably shouldn’t have modified and now i wanna replace it but Vista wont let me if this work i will father your children and i dont think you should be deleting System Volume Information i think thats important
I was able to use the commands to take control of the files, but not the folders. System was the only authorized user, administrator status didn’t matter. After the folders were empty then they were next to impossible to remove. However, I created a new user with administrator privileges. I logged on with the new user and was able to move the folders to the desktop of the new user. I then logged off, logged back on to regular userID and then deleted the user I had created. The folders were deleted with the user.
Im using vista ultimate 32bit
And i think i might have a virus running on my rundll32.exe, is it okay for me to delete it because i thought this is a major part of your computer, and it probably wouldnt run without it…
if you have any ideas on how to fix this virus, please let me know….Please Help!!!
christopherctw@yahoo.com
actually i dont know if its .exe it could be something else, but theres deffinately something wrong with a rundll32 file
So, how do I give back ownership to the TrustedInstaller after I’m finished replacing files?
Thnx for any advice
THANKS!! Works perfectly.
rundll32 is just a handler for other programs. So if they cause problems the error message will often mention rundll32 but that is not your problem. Four main suggestions for you:
1) Get antivirus and run it – AVG works very well for me and is free, if it doesn’t find anything then you probably don’t have a virus – just some badly behaved software
2) Get an anti-spyware scanner and clean your system with it
3) Uninstall as many programs as possible especially those free utilities, toolbars etc.
4) Check in msconfig (Start – Run, type msconfig) for the programs starting at boot (Startup tab) and untick anything you don’t like the look of or don’t care about (don’t worry you can go back in there later and put the ticks back one by one if you make a mistake)
hi im trying to delete a Roxio program file and i tried following the steps above with no success. Everytime i press delete it says you need permission to perform this action. They are dll files that im trying to remove. I installed roxio on my computer not realizing it was incompatible. It show up on my add remove programs. When i try doing it this way, it says ‘windows installer service cannot be accessed, this can occur if windows installer in not correctly installed”. Do you guys have any idea what i can do?
hi do it really work because i have upgrade from xp to vista and i have done formet to xp and the windows vista file has stead on my competr and i cannot delete the windows vista file please help!
Hey jonathan have you tried DR. Delete. google it. I managed to delete some hard files that way. Its a free tool
i was going to be mad!!! i got some win32 jeefo on some vista files.but they were not running.they were just staying in “system32/bla bla” folder. i tried kaspersky to get rid of them but it was useless.i got both XP and Vista on same computer and kaspersky was just telling me that the files are infected what do i want to do and option is “skip” nothing more.and it was popping up every minute! and it was happening on both vista and xp.than i saw this thread, made a list of infected files, created 2 different bat files for both commands.and run them.after that i pressed “disinfect all” and voila.they were clean as a baby. thank you so much for this info
Do you know if SP1 for Vista Home Premium has interfeared with the Remote Desktop fix that you helped with. I seem to be having trouble with it now.
Thank you for any advise,
Daniel S. Jarrett
jarrett001@comcast.net
I just got my vista ultimate laptop today.
I followed the steps as above.
I also had the problem of getting to the cacls step.
It says its depreciated and to use Icacls instead. I did that, following the same syntax and it tells me the filename, directory name, or volume label syntax is incorrect.
What should I do?
I’m trying to patch my uxtheme.dll along with some others to use some themes…
Help
Nothing worked for me. i still receive a message telling me i need permission
I’ve used the above to delete or modify some files and it worked great – thanks!
But now I’m stuck with a different problem: I have an folder with empty subfolders. I want to delete the lot, but Vista says ‘Can’t find the item’
‘The item no longer exists in this folder. Check the location of the item and try again’.
Well, I’ve tried again and again. I’ve taken possession of the folder etc., I can even move the folder, but I can’t delete the **** thing.
Anybody any suggestions? Help is very welcome!
Thanks,
Sarah.
Hi
can I use the same method to get rid of unwanted .lnk files that I cannot seem to get to delete anyother way?
Great! i was hoping to find this information for a while
Can’t thank you more!
Keep up the good work
Thanks,
Niels
I NEED HELP!
I’m trying to delete some files in Vista Premium under My Computer > OS: (C:) > Windows
What do I do? It’s not giving me permission to delete ‘Digital Locker’.
Thanks!
OK so I have a .TTF on my desktop that i cannot del for some time now, everytime I tried to del it an error message would come up
” FILE IN USE
This action con’t be completed because the file is open in another program, close the file and try again! ”
wtf? I have nothing open and I never even used that .TTF
Please Help!!!!!
Hi Sasha. In order to do this you must open task manager. Now click the processes tab and see all the things that are taking up RAM. Delete anything that is not needed. You must do this because sometimes when you close apps, they do not stop the process.
If you are deleting pagefile.sys using this method, once you have done the above, use the following command to delete
c:\> del -AH c:\pagefile.sys
Thanks so much. I was trying to delete mobsync.exe because of its annoying indexing, but i couldn’t. Now i can, thanks
Thanks for this piece of information. Now I’ve done patching and I need to restore the permissions back to the TrustInstaller, any ideas?
For some files, it may help to do this as well to perform the deletion.
1. Get your command prompt ready
2. Start Task Manager
3. In the processes tab find and stop explorer.exe. Your taskbar will disappear along with your start menu, etc. at this point.
4. In the applications tab find the cmd prompt you had open and switch to it.
5. Use the DEL command to erase the file
6. In Task manager use the File : New Task command or use your command prompt to restart explorer.exe
This basically just ensures that if explorer.exe is holding a handle open to the offending file it releases it.
Be careful my friends
Hi,
I tried Vista and didn’t like it much, so I installed XP again… Now I have one 10Gb Windows folder, and I can’t delete it…
Anybody help?
Hi all i got ownership ok but cannot find the file to delete it can someone provide the path or command plz. thanks loads
Sorry i forgot to say it just says could not find c:\pagefile.sys
but if i type c:\pagefile.sys it trys to run it so is it there or what…heh…thanks
Just go download this registry it will do the steps for you, and then you can easily take ownership. I tried the above steps both in safe and regular mode I got the same message as Jess, I still didn’t use Icacls made no sense to me. Ok good luck! A big hello to all my geek freinds from Zakinthos, Greece.
http://www.howtogeek.com/howto.....-in-vista/
This really worked! I only had to replace the nlasvc.dll file – reboot and the service started immediately and my network had recognition (away with the red X).
In my case – the lack of network recognition caused my wireless router to fail…it didn’t know who I (well, not me actually but my laptop) was.
Thank you for all your VERY helpful knowledge.
Thanks a lot for useful info. I still couldn’t del the pagefile.sys after changing ownership to Administrator, logging in safemode as Administrator. In the end, an old DOS command (used to hide files in old days) came in handy. I checked the file attributes, it was Hidden (h), System (S) and Archived (A). I removed all and then was able to delete.
to check attributes, remove them and then delete file (called filename.ext):
C:\attrib filename.ext
C:\attrib -h -s -a filename.ext
C:\del filename.ext
@bhoot007: pagefile.sys is an important system file used for virtual memory. It’s not something you should delete.
Thanks jd2066,
I should have mentioned I was doing that in order to get the vista volume shrink to work properly as here:
http://www.howtogeek.com/howto.....-problems/
However, had conveniently forgotten to switch the pagefile.sys mechanism back on… your timely email reminded me and I have set it up again.
Incidently, I was able to reduce the previously limiting shrink of 273GB to a mere 20GB (combination of running PerfectDisk defrag (system files) and shrink alternatively ( 5 or 6 times).
Thanks again.
urm. i have been trying to gain access to this system32 .dll which my trendmicro, unfortunately, has no way to clean or quarantine. and i have tried all the ways on the net and even thru safe mode, it still pops up a “You need permission to perform this action.”
Can someone help me with this
By the way, im using vista home edition
DaiLaughing:
I’ve tried every thing else, but your tip was the only one that worked! On everything except \Boot\-folder… But I can live with that.
You’re my hero
What would we ever do withouht you?
Oh and i must say thanks because i have managed to get rid of trustedinstaller.exe, now i just have to restart and hope it worked :~
@Benjie: Deleting trustedinstaller.exe is a bad idea. From a quick search, I found that it’s part of the Windows Installer. Windows Update depends on it and probably other programs too.
This works in Windows 7 too
Thanks for the information. I’ve done for windows server 2008, but with icacls command instead of cacls.
C:\ icacls C:\Windows\System32\xxxxxx.exe /grant administrator:D
Thank you – I love you, I will always look here first now when I have a probelm… PS whats the meaning of life
Hi ppl,
I work in video with Cs4 and after a crash of premiere, i lost my firewire connection.
Foruns after foruns, help desk, after help desk including microsoft, and toshiba, my conclusion is one, I need delete/restorer 1394 firewire sys file.
I have a toshiba laptop and run vista enterprise.
obsiously Vista d’ont permit deletation of any system file.
what can I do to solve the issue.
Best regard everybody
I don’t know what to do. Help me? please.
I’ve tried the unlocker and it doesn’t work, and apparently using the “cmd” thing I’m an admin but it still isn’t letting me uninstall/delete McAfee. I just want to delete McAfee and it’s telling me I need permission. I went through the security thing and gave myself permission, it still says I need permission. Somebody PLEASE help me.
thank you so so much Mr/GEEK \Sestem32\prof.geek
to mike :- [cacls C:\ *.* /G my-acer:F] should have been [cacls C:\ *.* /G Ironhorse:F]
my suggestion would be to create a user named my-acer and retry the whole proceedure or at least the takeown part. you should be abe to delete from there. or give permisions to ironhorse and delete from that account
bhoot you rock! it was killing me that even notepad could see the file (though not open it) but del wouldn’t. Gone now though. =)
Deleting ANY file under ANY windows system even the ones (operating systems) coming after windows vista is possible, but *PREVIOUSLY* you must backup whatever you attempt to delete especially WINDOWS root files.
To do so! you need a bootabe windows CD/DVD, let us say windows vista dvd,
then boot your computer from a CD/DVD. Enter the command prompt and write
del file name and press ENTER.
to find your file use (dir/p)command to locate the file in the directory
to copy file use (copy) command, and/or (xcopy /e) for a directory
write (help) to know moor about DOS commands.
Deleting ANY file under ANY windows system even the ones (operating systems) coming after windows vista is possible, but *PREVIOUSLY* you must backup whatever you attempt to delete especially WINDOWS root files.
To do so! you need a bootabe windows CD/DVD, let us say windows vista dvd,
then boot your computer from a CD/DVD. Enter the command prompt and write
(del) {file name} and press ENTER.
to find your file use (dir/p)command to locate the file in the directory
to copy file use (copy) command, and/or (xcopy /e) for a directory
write (help) to know moor about DOS commands.
Tanks for help.
The problem is around 1394.sys, firewire.
After a CS4 crash the firewire door never more work.
Under windows vista you d’ont have permission to reintall any file.
So, the situation is, or wait for a Vista firewire upgrade, or format computer, or try to install driver again.
To install driver again,I need delete old one.
What is the wright thing to do.
Best Regards
you are welcome Lee… just keep in mind to a) take back ups regularly and b) restore any system files as windows may not work properly without them
Thank you for your insight here. I was able to acquire ownership but when I try to establish control rights, I enter my user name as the previous command listed it, and I get the message “invalid parameter” then my user name in quotes. It shows my user name as nameofcomputer\firstname L(ast initial). Maybe that my username is my first name and last initial confuses the DOS(?) I don’t know but any help here would be much appreciated.
Thank you! works great
Thank you very much!
But my Vista (it’s a german version) shows that:
http://www.250kb.de/u/090415/j/ad26251f.jpg
Can you please actualize your article?
thank you very much for this very helpful tip.
i was able to delete my old windows 7 directory that was giving me trouble ’cause i cant delete it for about a week now. i just recovered that wasted gigs of my hard drive.
thanks again.
You might want to update your VISTA “cacls” advice on how to delete a file…in VISTA, cacls is no longer…now it’s ICACLS with some other syntax changes such as /grant instead of /G and several other annoying features (!) but it works with takeown…
good job it’s works
I reinstalled vista by after removing old vista. but it has created a windows.old folder which I cannot able to delete it. Can I remove i?
Works great thanks!
It works great thanks.
It worked! Once I switched to safe mode, that is. Thank you! Now I just hope that file I removed was actually that adware I’ve been trying to trace down…
Worked brilliantly, thanks. Also thanks to Alan for the technique with multiple files, saved me the hour or so it would have taken to find that out myself by playing around a bit.
I tried the takeown command and it worked when the filepath names contained no spaces. However I am getting errors (I’ve also seen it reported by others) when the filepath name contains spaces. I tried changing the spaces to the wildcard *. The message then was that it could not find the file. How can I resolve this?
it doesnt work for me
it tells me – ERROR: the system cannot find the file specified
i know its there and wont let me delete cos i dont have ownership…..anybody help please!!!!!!
Thanks, worked brilliantly although I found that I only had to restart the computer normally and not boot into safe mode.
Thank you, it worked like charm