How to fix Vista driver cache
I've installed Vista on 3 machines now, and on all 3 something I've done has caused the Vista driver cache to become corrupt. So, when plugging in a USB device which it should recognize automatically, it instead says "Driver not found" and gives me options to repair it. While you can tell it to browse for a location manually, and choose c:\windows to get around this, I have created a batch file which will allow you to force Vista to rebuild the driver cache. You have to be an administrator on your system to use it, and it works with UAC enabled.
Create a batch file with the following content and execute it as an administrator (Right click it, choose Run as Administrator). It will create a directory labeled \windows\inf\infbk-XXXX (where the XXXX is replaced with a random number), set the relevant files to be owned by "Administrators", give "Administrators" full control over the files, and move them to the backup folder. After running this you should be able to just plug in a new device, although you might want to reboot first.
Here is the content of the batch file:
@echo off
TITLE Repairing Inf Cache
rem change to drive where windows runs
%SystemDrive%
rem change to the \windows\inf folder
cd %SystemRoot%\inf
rem create random directory for backup
set FOLDERNAME=infbk-%RANDOM%
mkdir %FOLDERNAME%
rem list of files which need to be removed
set FILE1=INFPUB.DAT
set FILE2=INFSTOR.DAT
set FILE3=INFSTRNG.DAT
set FILE4=INFCACHE.*
set FILE5=SETUPAPI.*
rem take ownership of the first file
takeown /f %FILE1%
rem grant full control to 'administrators'
icacls %FILE1% /grant administrators:F /t
rem move it to the backup folder
move %FILE1% %FOLDERNAME%
rem same for the other files
takeown /f %FILE2%
icacls %FILE2% /grant administrators:F /t
move %FILE2% %FOLDERNAME%
takeown /f %FILE3%
icacls %FILE3% /grant administrators:F /t
move %FILE3% %FOLDERNAME%
takeown /f %FILE4%
icacls %FILE4% /grant administrators:F /t
move %FILE4% %FOLDERNAME%
takeown /f %FILE5%
icacls %FILE5% /grant administrators:F /t
move %FILE5% %FOLDERNAME%
echo Successfully moved all infcache related files to %FOLDERNAME%
pause
59 Comments:
*finally* a solution to this problem that "just works". No turning off UNC, no trying to follow instructions that someone said 'worked for him', but a simple, quick answer that finally did the trick for me.
Thanks!
Thank You Very Much!!! I've been struggling with my USB mouse for days now. And thanks to you HowTo, I got it up and running. Thanks again.
omg it worked, it worked... Ohhh my gawd it worked! For weeks I've been struggling with this and now my problem has been fixed.
Thanks, thank you so much!!
Which are the relevant files ?
Thank you for your help
What do you mean, "move them to the backup folder"?
Didn't work for me. Maybe because I didn't move the file to the 'backup folder' (wherever that is) HEEEEELP!
please give more detailed instructions ! thank you
This fix worked fantastically. How did you find out to do this?
Could you please explain what folder you're referring to when you're talking about "the backup folder"? More detailed information would be appreciated, thanks!
Anonymous, the backup folder referred to in his post is created by the batch file itself. You do not have to do anything but create the .bat file and run it for the process to work its "magic".
I found that after I ran the batch file, I had to reboot and manually search for drivers again, but this time the OS picked them up and installed successfully.
Many thanks for this incredibly useful nugget of info, i've passed on the link so hopefully more peeps can make use of it. Thanks agains
BIGG thanks, you saved me alot of work.
Thanks!!
Guys how do you give "Administrators" full control over the files? and the other bit about administrators?
Cheers
Thanks so much for this. You have just saved me a lot of time. If only Google had have found you quicker! Works perfectly. I don't need to wipe my machine now.
i know this is quite a bit later, but i used this a couple months ago and it worked, but just recently a vista update (either (KB938371)or (KB890830)) and this causes my computer to turn of fine,and i can still access its files through my network, but as soon as the update came i could not use any usb devices at all anywhere, so i had to restore with a recovery, the only culprate i can think of was this mod, as ive done no other changes to my os, i was just wondering if this has happend to you or anyone else that has used this,
rob, rechik97@hotmail.com
THANKS so much! like allen i've been struggling to solve my vista-mouse problem for days. Your solution is so easy. What i did:
1. create the batch file, just name it anything with .bat and i saved it on my desktop.
2. right click and run it as administrator
3. reboot
4. with PS/2 mouse, it will immediately work. for USB might need to manualy search for drivers again.
Woohoo, finally this works. Thank you so fucking much =).
I love ya!
Thanks so much i had the same problem when trying to plug in any device i had, but now it all works. THANKS SOO MUCH
Finally Someone with a little Brains!! Thanks for the fix!!
What about fixing the same issue in XP?
simply genius
Awesome! Thanks!
I tried this script on Vista SP1 and it really screwed up my computer. Now no drivers will load. It says "Windows found driver software for your device but encountered an error while attempting to install it". "The system cannot find the file specified". Now none of the built-in Windows drivers can install. Restoring the backups doesn't work either, and SFC /scannow can't fix it. Unfortunately, I changed hard drivers recently and didn't realize my System Restore isn't working, so now my PC is royally screwed.
This helped me a lot too! Although I had to do one more step,
Point the Update Driver wizard to:
c:\Windows\System32\DriverStore\FileRepository\
Thank you very much! been having this problem a long time now... it´s the first time i can transfer more than 3 albuns to my jump drive...
Nothing has worked for me so far...
Anyone has another solution?
OMG--you just ended a 48 hour nightmare! My problem was much deeper--I couldn't boot into my other operating system because the driver cache entry for "generic volume" became corrupt, and Vista wouldn't allow me to mount and fix that drive...and it wouldn't even let me manually point it to the inf. I was about to delete the other partition and start from scratch...BUT NO LONGER! THANK YOU!
Thanks!
have a PC running Vista with SP1 which had problems with a Netgear WG111T USB WiFi adaptor, the Netgear utility wouldn't run and there were occasional blue screens, typically when trying to hibernate the system, reporting an error in WG11TND5.SYS. Attempts to re-install the driver gave an error along the lines of "name is already in use as either a service name or a service display name".
Booting in safe mode, deleting all "netgear" and WG11* references and folders on the system didn't help.
Running the batch file did ... as I was then able to re-install the software and the driver, it is now working perfectly (including hibernate) - so a big pat on the back - and it works fine on Vista SP1 for me!!! :-)
Dan SJK
Thank you very much Peter, you saved my life.
After rebooting my laptop due to the unresponsiveness of Vista, I lost the connection to wireless keyboard and mouse. I spend a day to look for a solution from Microsoft support site and numerous technical pages without any success. Your batch file and a reboot fixed it for me.
I cannot believe that something discovered in 2007 is still causing trouble and there is no solution from Microsoft.
Damn you Microsoft, Damn you Vista.
Cheers,
Tevfik
Sorry, how do you do the following action (the one Henson mentioned):
Point the Update Driver wizard to:
c:\Windows\System32\DriverStore\FileRepository\
thanks,
Jaime
Oh my goodness, that's amazing.
THANK YOU!!
i saxed this bat file for future. but i accidenlty ran it. Now NONE of my usb drivers are uptodate and i cannot find updates for them. YES i tried manually to update no use and i tried to find online no use so far. Perhaps you could firect us as to where the backup file is. My sys back up was on a HDD but of course NONE of the usb devices work. And i recommended this to many friends in a forum. THANK GOD i listed your site so you could get the credit. Unfortunately the restoe point i could have used was auto deleted by vista i understand this is an old blog and useful for many so it prolly works well but i had a glitch and do not know fow to fix unless i do a total recovery, Please advise
I was minutes away from re-installing Vista from scratch....thanks so much for this, worked like a charm...
I haven't been able to use a flash drive for months and it has been such a pain! thanks!
You are the man. EVERY morning, I would have to go through the process of reinstalling my video driver.
I was unable to update my Intel Matrix drivers, and my Blackberry and Garmin GPS unit would also fail at the driver installation. I created the batch file, rebooted my PC and ran it. Sure enough, this resolved the issue. THANK YOU!!! BTW, I'm running Vista 64bit with SP2
Wow.... after dealing with the hardware wizard popping up every time I plug in a device for a few months, it finally got the point where I couldn't deal with it any longer. I couldn't use my wacom tablet for a project, even after reinstalling the driver.
This totally saved me, thanks!
I'm still a little confused. I saved the file as a .bat and ran the program and then I restarted the computer but my USB mouse still doesn't work.
Can you explain in more detail or have a video explanation somewhere? It's a pain not being able to use my Logitech mouse anymore and I hate using the touchpad.
This worked, fixed my mouse problems with my new laptop in seconds after I had previously spent hours tinkering around with the settings. Thanks so much for your help!
Thanks a mil... now all my usb devices worked flawlessly except my external HDD which worked when i pointed vista to the filerepository folder and it installed ok!
Now i know why people hated vista so much when PnP means plug and pray ;)
Thank you sooo much!
I was really loosing my rag!
Bat file worked a charm, and i can finally stop having to use my iphone as a mouse!
14/12/09
Unfortunately, It did not help. I have the sme problem and still looking for the solution.
Worked like a charm! Now I can actually use my brand new Sweex mouse on my Vaio running Vista Home Premium. Spent days trying to fix this before I found this post.
Thanks!
I'm actually surprised at how well this worked. Kudos!
I'm a pretty dumb guy, but, how do I create a .bat file? I'm not really a computer guy but this issue just happened to me recently and I'm pretty excited for this one to work after all the positive feedback from other people. Your help would be very much appreciated, thanks (:
Saved my life! Thanks!!!
Hey! It really works! Thanks to author and big-big respect!
I might be the only person here who actually deleted his own driver cache based on a article I read with tips on conserving space with Vista. Needless to say, any new device (USB flash drive) or changes to a current device (flashed my dvd-rom burner bios) and it keeps asking for drivers and never finding them. For months.
Then I won the google guess the right key word (vista driver cache) and found this and it worked immediately.
Thank you Peter!
great! this patch solved my problem!!
USB mouse is working
Thank you, thank you, thank you. On August 9, 2011 this fix still works!
Peter - a HUGE thank you. I'm an IT 'expert' but I couldn't fix this problem, have been trying on and off for days! Within a few moments of reading your post my friend's PC could use it's USB ports again.
Many, many thanks
Todays date is 10-30-11 and the file worked for me. I bought a logitech USB wireless mouse and it didnt work upon plug in the USB adaptor.
I created the .BAT file in microsoft notepad, copied the next from above, saved it on my deskptop, right clicked and ran as administrator. The black window oppoed up stated it successfully relocated files. I then re-plugged in the USB connection and the mouse worked after about 10 seconds.
Im running MS Windows Vista Home Premium Service Pack 2.
THANKS!!!
Thank you, made my day. ;)
Am I missing something?
The explanation makes no sense.
Yes, I can it and yes I see a folder in /windows/inf but the next part makes absolutely no sense.
Move what to what backup area?
Do i move that folder to somewhere, do I move the inf/ files into it? What am I doing next?
You're explanation is flawed and I'm really struggling to understand how everyone else worked that part out.
I am confused as well about what to do!
The info is new for me..I like this..thanks for sharing.
Church Software
good blog really , please can you give me your opinion in my blog
http://flashdrive-repair.blogspot.com
thanks to this i have issue on start-up my windows 7 , it is like freezing to long , but now it start not too long like before doing this.. thanks for sharing and teaching this programs..
is it okey if i forgot to buck up the original folder..
This is incredible! After praying, I was led to this post. I had been tearing out my hair installing a printer on this VISTA machine, and now it installed perfectly! To God be the glory (and you get some props too :-)
Post a Comment
<< Home