Forums
 

Editing a file in \windows\inf


Reply
 
Thread Tools Search this Thread
Old 17-09-2012, 18:22   #1
Loobster
Forum Member
 
Join Date: Mar 2003
Services: Win7x64, i7-2600k, 16GB DDR3, 128GB SSD v3 + 2TB Spinpoint, GeForce 8600GTS
Posts: 11,158
Editing a file in \windows\inf

So due to some kind of corruption or something, I have a Windows 7 PC with no networking at all, LAN and WLAN do not work.

The LAN and WLAN adapter and also three miniport 'adapters' have exclamation marks in Device Mangler.

Uninstalling and reinstalling the drivers for the physical adapters gets them back in there with a status of 'working properly' (allegedly). However without reinstalling the miniport stuff there's still no network access.

I've tried following this article but I cannot comment out the section in the .INF file because Windows won't let me resave the file after the edit.

I've tried saving it under another name but can't delete the original file to replace it with the modified one. I've tried booting off mini-XP to manually delete the file without 7 running, access denied.

There are no attributes on the file except archive, no system or hidden properties etc.

Even a local administrator apparently doesn't have permissions to edit the ACL on the file or on the parent folder.

How the hell are you supposed to edit and save a file in this folder?
Loobster is offline   Reply With Quote
Please sign in or register to remove this advertisement.
Old 17-09-2012, 18:43   #2
squack
Forum Member
 
Join Date: Nov 2004
Location: Pembrokeshire, Wales
Services: Sony KDL32EX503U, Sony BDP-S350, Sky+ HD, IDNET Home Plus
Posts: 555
Try saving the edited file onto the desktop, or somewhere that you have permission to save it to and then copy it back into the windows\inf folder and allow the UAC prompt.

I've seen this when trying to edit files in protected directories as UAC doesn't seem to pop up to let you allow the save it just plain refuses.

Hope that helps.
squack is offline   Reply With Quote
Old 17-09-2012, 19:04   #3
ForestChav
Forum Member
 
Join Date: Jul 2006
Location: Nottingham -You lost the game!
Services: VM 10Mb, Sky+, WHS2011, Win7, iphone 4S 32GB, Squeezebox Duet
Posts: 31,589
Run Notepad as administrator, then open the files.
ForestChav is offline   Reply With Quote
Old 17-09-2012, 19:06   #4
max99
Forum Member
 
Join Date: Jun 2005
Posts: 8,496
Yep, saving the file in a different location and then copy/pasting over the original file usually works. But the question now is whether or not this specific file can actually be overwritten. If not, the usual fallback of booting from Linux should allow you to delete or replace the original file.
max99 is offline   Reply With Quote
Old 17-09-2012, 19:08   #5
Maxatoria
Forum Member
 
Join Date: Apr 2011
Services: Old Boilers
Posts: 3,004
sometimes its worth burning a linux live iso as it will have ntfs support and won't be riddled with some of the problems that windows will have, that assumes you know linux enough to be able to mount a filesystem and edit a file should the live cd not do it for you
Maxatoria is offline   Reply With Quote
Old 17-09-2012, 19:26   #6
whoever,hey
Forum Member
 
Join Date: Mar 2006
Services: A hoover or some other generic vacuum cleaning machine.
Posts: 27,599
Quote:
Originally Posted by ForestChav View Post
Run Notepad as administrator, then open the files.
^ this. Its the same as editing the hosts file.
whoever,hey is offline   Reply With Quote
Old 17-09-2012, 19:37   #7
IvanIV
Forum Member
 
Join Date: May 2006
Posts: 18,880
I think there's a bigger chance binary files referenced in inf file are corrupted and the inf itself is OK. You'd see immediately it's wrong, it's a text file. I'd say check those binary files, compare with a running OS.
IvanIV is offline   Reply With Quote
Old 17-09-2012, 19:48   #8
bob187
Forum Member
 
Join Date: Dec 2007
Posts: 1,007
As others have said, run notepad as administrator, then open the file and edit.
Alternatively, turn off UAC and it should let you edit it normally.
bob187 is offline   Reply With Quote
Old 17-09-2012, 20:45   #9
Stig
Forum Member
 
Join Date: Sep 2003
Location: Sandy Heath, Beds, UK
Posts: 5,014
Quote:
Originally Posted by Loobster View Post
So due to some kind of corruption or something, I have a Windows 7 PC with no networking at all, LAN and WLAN do not work.

The LAN and WLAN adapter and also three miniport 'adapters' have exclamation marks in Device Mangler.

Uninstalling and reinstalling the drivers for the physical adapters gets them back in there with a status of 'working properly' (allegedly). However without reinstalling the miniport stuff there's still no network access.

I've tried following this article but I cannot comment out the section in the .INF file because Windows won't let me resave the file after the edit.

I've tried saving it under another name but can't delete the original file to replace it with the modified one. I've tried booting off mini-XP to manually delete the file without 7 running, access denied.

There are no attributes on the file except archive, no system or hidden properties etc.

Even a local administrator apparently doesn't have permissions to edit the ACL on the file or on the parent folder.

How the hell are you supposed to edit and save a file in this folder?
Frankly, if you have that kind of damage to the operating system it's going to be very hard to repair. Was the damage done by a virus?

You have done what I would have tried, which is removing and reinstalling all the NIC drivers. I assume you tried System Restore too.

Sometimes the only proper fix is a reinstall of Windows.
Stig is offline   Reply With Quote
Old 17-09-2012, 21:32   #10
LION8TIGER
Forum Member
 
Join Date: May 2005
Posts: 6,318
Loobster, have you tried step 20 in your link or maybe better post #21 here.
LION8TIGER is offline   Reply With Quote
Old 17-09-2012, 21:54   #11
Stig
Forum Member
 
Join Date: Sep 2003
Location: Sandy Heath, Beds, UK
Posts: 5,014
Quote:
Originally Posted by LION8TIGER View Post
Loobster, have you tried step 20 in your link or maybe better post #21 here.
Aw crap, I didn't realise the OP was Loobster.

Yes, you could try resetting the whole TCP/IP stack.

You don't actually need all the 'miniport stuff' unless you are using some kind of VPN. Just a working adaptor should be enough.
Stig is offline   Reply With Quote
Old 17-09-2012, 22:55   #12
ForestChav
Forum Member
 
Join Date: Jul 2006
Location: Nottingham -You lost the game!
Services: VM 10Mb, Sky+, WHS2011, Win7, iphone 4S 32GB, Squeezebox Duet
Posts: 31,589
Quote:
Originally Posted by bob187 View Post
Alternatively, turn off UAC and it should let you edit it normally.
No... gone are the days where you have to turn off UAC to get things to work. (You can just set it to run as Admin as a last resort).

It's widely acknowledged that even if you know what you are doing that running everything with administrative rights (which is what happens with UAC off) breaks the security model of Windows post-XP, and leaves you much more prone to viruses and other malware taking control of your machine.

Now that most applications have learned how to coexist with UAC, advising that someone runs without UAC is (to me) akin to recommending that they run no anti-virus.
ForestChav is offline   Reply With Quote
Old 17-09-2012, 23:18   #13
whoever,hey
Forum Member
 
Join Date: Mar 2006
Services: A hoover or some other generic vacuum cleaning machine.
Posts: 27,599
Quote:
Originally Posted by ForestChav View Post
............advising that someone runs without UAC is (to me) akin to recommending that they run no anti-virus.
And shows ignorance.
whoever,hey is offline   Reply With Quote
Old 18-09-2012, 00:00   #14
LION8TIGER
Forum Member
 
Join Date: May 2005
Posts: 6,318
Quote:
Originally Posted by ForestChav View Post

Now that most applications have learned how to coexist with UAC, advising that someone runs without UAC is (to me) akin to recommending that they run no anti-virus.
Quote:
Originally Posted by whoever,hey View Post
And shows ignorance.
Does this mean that my XP machine is infected ??

If bob187 had said ''Alternatively, turn off UAC and it should let you edit it normally but when you have edited switch it back on again'', would that have been ok ?
LION8TIGER is offline   Reply With Quote
Old 18-09-2012, 00:09   #15
whoever,hey
Forum Member
 
Join Date: Mar 2006
Services: A hoover or some other generic vacuum cleaning machine.
Posts: 27,599
Quote:
Originally Posted by LION8TIGER View Post
Does this mean that my XP machine is infected ??

If bob187 had said ''Alternatively, turn off UAC and it should let you edit it normally but when you have edited switch it back on again'', would that have been ok ?
Its nothing to do with your XP machine would have been infected.

It wouldn't have been any different to just running as admin or compatibility settings.
whoever,hey is offline   Reply With Quote
Old 18-09-2012, 00:33   #16
LION8TIGER
Forum Member
 
Join Date: May 2005
Posts: 6,318
Quote:
Originally Posted by whoever,hey View Post
Its nothing to do with your XP machine would have been infected.

It wouldn't have been any different to just running as admin or compatibility settings.
My jest about XP being infected was because I didn't agree with FC's comparison of UAC and Antivirus as to me they are totally different things.

I agree about running as admin etc though.
LION8TIGER is offline   Reply With Quote
Old 18-09-2012, 01:21   #17
Loobster
Forum Member
 
Join Date: Mar 2003
Services: Win7x64, i7-2600k, 16GB DDR3, 128GB SSD v3 + 2TB Spinpoint, GeForce 8600GTS
Posts: 11,158
Quote:
Originally Posted by squack View Post
Try saving the edited file onto the desktop, or somewhere that you have permission to save it to and then copy it back into the windows\inf folder and allow the UAC prompt.
Tried and failed.

Quote:
Originally Posted by ForestChav View Post
Run Notepad as administrator, then open the files.
Tried and failed.

Quote:
Originally Posted by max99 View Post
Yep, saving the file in a different location and then copy/pasting over the original file usually works. But the question now is whether or not this specific file can actually be overwritten. If not, the usual fallback of booting from Linux should allow you to delete or replace the original file.
Tried with mini-XP, failed. May see about a linux CD.
Loobster is offline   Reply With Quote
Old 18-09-2012, 01:21   #18
Loobster
Forum Member
 
Join Date: Mar 2003
Services: Win7x64, i7-2600k, 16GB DDR3, 128GB SSD v3 + 2TB Spinpoint, GeForce 8600GTS
Posts: 11,158
Quote:
Originally Posted by whoever,hey View Post
^ this. Its the same as editing the hosts file.
It's not. It's way more protected. You can edit the hosts file much more easily.
Loobster is offline   Reply With Quote
Old 18-09-2012, 01:23   #19
Loobster
Forum Member
 
Join Date: Mar 2003
Services: Win7x64, i7-2600k, 16GB DDR3, 128GB SSD v3 + 2TB Spinpoint, GeForce 8600GTS
Posts: 11,158
Quote:
Originally Posted by Stig View Post
Frankly, if you have that kind of damage to the operating system it's going to be very hard to repair. Was the damage done by a virus?

You have done what I would have tried, which is removing and reinstalling all the NIC drivers. I assume you tried System Restore too.

Sometimes the only proper fix is a reinstall of Windows.

This is what I am leaning towards.

Not sure about a virus. The user admits to running 'System Mechanic' the evening before 'it just stopped working'.

I wasted more time than a flat reload would have taken today, but not as much as it will take for reload/app installs/data restore.
Loobster is offline   Reply With Quote
Old 18-09-2012, 01:26   #20
Loobster
Forum Member
 
Join Date: Mar 2003
Services: Win7x64, i7-2600k, 16GB DDR3, 128GB SSD v3 + 2TB Spinpoint, GeForce 8600GTS
Posts: 11,158
Quote:
Originally Posted by Stig View Post
a) Aw crap, I didn't realise the OP was Loobster.

b) Yes, you could try resetting the whole TCP/IP stack.

c) You don't actually need all the 'miniport stuff' unless you are using some kind of VPN. Just a working adaptor should be enough.
a) Lol.

b) Tried the netsh command - no dice

c) Well the LAN and WLAN adapters are 'working normally' according to windows, yet I have no network adapters even showing as being installed in Network and Sharing Center.
Loobster is offline   Reply With Quote
Old 18-09-2012, 01:27   #21
Loobster
Forum Member
 
Join Date: Mar 2003
Services: Win7x64, i7-2600k, 16GB DDR3, 128GB SSD v3 + 2TB Spinpoint, GeForce 8600GTS
Posts: 11,158
Thanks all for your feedback so far.

I will give it one more try in the morning, then I am reloading it.
Loobster is offline   Reply With Quote
Old 18-09-2012, 01:38   #22
max99
Forum Member
 
Join Date: Jun 2005
Posts: 8,496
Quote:
Originally Posted by Loobster View Post
Tried with mini-XP, failed. May see about a linux CD.
Any form of Windows is likely to prevent you from modifying/overwriting the file, but Linux won't give a crap.

Quote:
Originally Posted by Loobster View Post
I wasted more time than a flat reload would have taken today, but not as much as it will take for reload/app installs/data restore.
I really hate it when you reach the point where you either:
  1. risk spending even more time on increasingly futile 'fixes'.
  2. begrudgingly accept that you've wasted several hours and now need to spend several more hours going for a complete reinstall.
max99 is offline   Reply With Quote
Old 18-09-2012, 21:46   #23
s2k
Forum Member
 
Join Date: Apr 2006
Posts: 4,302
Admittedly i've never actually seen this do anything myself, but since nobody else has suggested it you could try sfc /scannow from an elevated command prompt?
s2k is online now   Reply With Quote
Old 18-09-2012, 22:57   #24
max99
Forum Member
 
Join Date: Jun 2005
Posts: 8,496
Quote:
Originally Posted by s2k View Post
Admittedly i've never actually seen this do anything myself, but since nobody else has suggested it you could try sfc /scannow from an elevated command prompt?
You're not the only one - I don't think I can even recall hearing anyone say that it worked. I've never understood why it became such a common 'cure-all' recommendation.
max99 is offline   Reply With Quote
Old 19-09-2012, 02:42   #25
Loobster
Forum Member
 
Join Date: Mar 2003
Services: Win7x64, i7-2600k, 16GB DDR3, 128GB SSD v3 + 2TB Spinpoint, GeForce 8600GTS
Posts: 11,158
Laptop was restored to factory defaults using recovery partition this morning by one of my techs.

Would have been interested to figure out the fix - or maybe the recovery was the only fix.
Loobster is offline   Reply With Quote
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search

 
Forum Jump


All times are GMT +1. The time now is 17:11.