Accidentally ran attrib -h -r -s /s /d c: \*.* on my C: (OS drive) and now all files have different attributes, how to restore to defaults?

sram

[H]ard|Gawd
Joined
Jul 30, 2007
Messages
1,468
I suspected a virus in my system because I wasn't able to view hidden files in some folders even after I select view hidden files in folder options in windows explorer and ended up running the command in the title for my c: drive. It didn't execute fully because access to some files was denied but many files/folders changed their attributes. Is there a way to restore file and folder attributes to default values in my c: drive? Unfortunately, I didn't have system restore on when this happened. Now my files/folders are a mess. Many files which were supposed to be hidden are viewable because they are not hidden anymore and this is not good. I don't want anybody using the pc to miss with system files and hidden files.

Thanks.
 

Macho

Weaksauce
Joined
Jul 26, 2020
Messages
71
CMD as administrator.









ATTRIB - DOS Command​

https://www.csulb.edu › ~murdock › attrib



attrib /? gives you the various switches to use. You simply turn it off with a minus switch (-). Dir *.exe gives you all the many DOS commands to use. It used to be with DOS and MSDOS this was all that they had to use.
After just having BASIC to use a computer, they compiled .com files. The same as .exe files that command.com had the ability to run. Now it is CMD.com or CMD.exe that shells you out of Windows to DOS. exit to exit back to Windows shell. They tried to keep us in a shell above DOS right from the start.
 

travm

[H]ard|Gawd
Joined
Feb 26, 2016
Messages
1,836
Time to reinstall windows mate. Make good backups first. Buy an external HDD if you don't already have one
 
Last edited:

NIZMOZ

2[H]4U
Joined
Oct 23, 2007
Messages
2,122
You can't. Reinstall is the only way to put them back to the way they were. Every folder, whatever it was originally set too is now set to what you asked it to do.
 

travm

[H]ard|Gawd
Joined
Feb 26, 2016
Messages
1,836
Indeed. What NIZMOZ said. This lesson must be learned, command line has no undo, very unforgiving.

Also if you thought you had a virus, its time to nuke that install from orbit.
 
Joined
Apr 22, 2015
Messages
568
I agree - you need a fresh install.
After a fresh install with your basic programs, time to use Macrium Reflect to make a copy of the OS. With a monthly backup, which is what I do, you can restore the OS back to a working state in less than 15 minutes.
 

Macho

Weaksauce
Joined
Jul 26, 2020
Messages
71
I agree - you need a fresh install.
After a fresh install with your basic programs, time to use Macrium Reflect to make a copy of the OS. With a monthly backup, which is what I do, you can restore the OS back to a working state in less than 15 minutes.
I always use Aoemi Backerupper to put a system image on my second hard drive to restore it back at times like this. Their Standard Backerupper is free. Or you could have put the system image on a USB.
How about using RESTORE? You could restore to an earlier time period before you did that.
Do you see the DOS command for restore? Or you can use your Windows shell user interface menu and restore. F8 and then you may see the Windows 10 options. Advanced to restore or refresh your computer with a fresh install of the OS.
First, save all your files that may get deleted onto a USB to put back later and write down any keys for the software you have in a notebook.
 

sram

[H]ard|Gawd
Joined
Jul 30, 2007
Messages
1,468
Oh guys! Thanks for all the input. The thing is that this install is in one of the laptops my family uses, hence it is not being taken care of heavily. My main machines all have backups, but not this one. Anyways, I remember in the old days you can force reinstall windows and it will just correct whatever is wrong with your install. I mean not a fresh install but an install over an old installation. Can you still do this?

What I'm trying to avoid is reinstalling software programs and re-configuring the system. Data files are in a separate drive partition so they won't be affected even if I format my C: drive and perform a fresh install on it.
 

travm

[H]ard|Gawd
Joined
Feb 26, 2016
Messages
1,836
I would personally format c and reinstall. I don't think the installer would be smart enough to know that you modified the file attributes on every file on the system. Also you'll clear up any virus concerns that way
What kind of special configurations would you have? Doing this on a typical system at my house is 2-3 hours, includes a careful backup of files and reinstall. I always download fresh Windows image first as well.
 

philb2

Gawd
Joined
May 26, 2021
Messages
750
I would personally format c and reinstall. I don't think the installer would be smart enough to know that you modified the file attributes on every file on the system. Also you'll clear up any virus concerns that way
What kind of special configurations would you have? Doing this on a typical system at my house is 2-3 hours, includes a careful backup of files and reinstall. I always download fresh Windows image first as well.
For me, unfortunately, a typical clean install is like 10-15-20 hours, what with all the program installs, finding and reentering license codes, maybe having to discuss with MS why I'm doing yet another install of Office, and then setting configs. Not my most funnest thing to do.
 

travm

[H]ard|Gawd
Joined
Feb 26, 2016
Messages
1,836
For me, unfortunately, a typical clean install is like 10-15-20 hours, what with all the program installs, finding and reentering license codes, maybe having to discuss with MS why I'm doing yet another install of Office, and then setting configs. Not my most funnest thing to do.
Make sure you gather those things beforehand, also license codes are almost history. How many codes could you have?
Windows, office, Photoshop, ?
Also for next time write them all down in a gdam book. Along with other important/useful computer into.
 

DeaconFrost

[H]F Junkie
Joined
Sep 6, 2007
Messages
11,505
For me, unfortunately, a typical clean install is like 10-15-20 hours, what with all the program installs, finding and reentering license codes, maybe having to discuss with MS why I'm doing yet another install of Office, and then setting configs. Not my most funnest thing to do.
That sounds extreme. I keep passwords and license keys in Bitwarden. All my drivers and required apps are on a flash drive that I keep updated. A clean install is maybe 2 hours tops, if that, not including Steam downloads. A little planning goes a long way.
 

philb2

Gawd
Joined
May 26, 2021
Messages
750
Make sure you gather those things beforehand, also license codes are almost history. How many codes could you have?
Windows, office, Photoshop, ?
Also for next time write them all down in a gdam book. Along with other important/useful computer into.
I keep all my install software on a separate Windows partition, along with software downloads that I might want to try out. For software that originally came on DVD (very little anymore) I have created ISO files.

I have a bunch of $30 ~ $50 utilities, all with codes.I do have everything written down, in an Access db, so i can cut/paste the license codes.

With all that, it's still taking too freakin long to do a clean install.
 

Eulogy

2[H]4U
Joined
Nov 9, 2005
Messages
2,674
From fresh, I can have my work/dev box back to how I want in about 30-40 minutes. It's all done with just an ansible playbook.
For my gaming rig, it takes a little more time, but, maybe ~2 hours total to get it all exact how I want. I keep wanting to make an ansible playbook for that, but, it's a lot more effort for windows.

I keep all my software keys in LastPass. Don't even have to install anything for them, just open the website and there they are, so I have them with me everywhere. It's cached on my phone and gaming rig just in case I don't have internet access, too.
 

philb2

Gawd
Joined
May 26, 2021
Messages
750
From fresh, I can have my work/dev box back to how I want in about 30-40 minutes. It's all done with just an ansible playbook.
For my gaming rig, it takes a little more time, but, maybe ~2 hours total to get it all exact how I want. I keep wanting to make an ansible playbook for that, but, it's a lot more effort for windows.

I keep all my software keys in LastPass. Don't even have to install anything for them, just open the website and there they are, so I have them with me everywhere. It's cached on my phone and gaming rig just in case I don't have internet access, too.
Lastpass, sounds like a good idea. I started my Access database maybe 10-12 years ago.
 

Eulogy

2[H]4U
Joined
Nov 9, 2005
Messages
2,674
Lastpass, sounds like a good idea. I started my Access database maybe 10-12 years ago.
Yeah. Any of the password managers can work for it. BitWarden and KeyPass2 also work well. I just like LastPass best, for me.
 

Macho

Weaksauce
Joined
Jul 26, 2020
Messages
71
See my reply, message #17. That said, this is still a great utility and I have just downloaded it.
Disable your anti virus protection and use RESTORE. Restore to a earlier restore point. It works like magic to over write all your file attributes. You wanted to know how to reset back to original file attributes and RESTORE works. It is important to disable your anti virus protection so do not forget or it will not be successful. Restore points are put in but you could lack restore points and that is why restore would not work if you did not have one. Restore to the day before you used Attrib.
 
Top