How Do You Create a "Protected Operating System File"?

Page 1 of 3 123 LastLast

  1. Posts : 54
    Windows 7 RC (Build 7100)
       #1

    How Do You Create a "Protected Operating System File"?


    Hey all,

    This is a weird question, but I've been trying to figure out how to CREATE a "protected operating system file/folder." For example, "desktop.ini" is one.

    My story is that I accidentally deleted a junction (the C:\Documents and Settings junction which maps to C:\Users for backwards compatibility). I created a new one using the command-line mklink tool, but the folder is not marked as a "protected operating system file", so when I turn the option on to hide those, it still shows up.

    The only thing I can find online that is special about these files is that they have the System and Hidden attributes both turned on. I have turned these on, but it still shows up, so there seems to be another flag behind the scenes that marks files as "protected" files.

    Any search turns up a million tutorials for how to go into the Folder Options GUI and turn on/off the "show..." option. Does anyone know how to do this? Let me know if I need to elucidate.
      My Computer


  2. Posts : 71,980
    64-bit Windows 11 Pro for Workstations
       #2

    Hello Jim,

    You might see if using this command in a elevated command prompt, then restart the computer may work. It should make it a hidden system file.

    attrib +s +h full folder path /S /D

    or

    attrib +s +h full folder path /S /D /L

    Hope this helps some,
    Shawn
      My Computer


  3. Posts : 54
    Windows 7 RC (Build 7100)
    Thread Starter
       #3

    Ah! Got it! It was the /L. It must've been setting the properties of Users instead of Docs and Settings every time I used +h +s. Thanks for the help; I was really scratching my head about it.
      My Computer


  4. Posts : 71,980
    64-bit Windows 11 Pro for Workstations
       #4

    You're most welcome. :)
      My Computer


  5. Posts : 1
    Windows 7 Home Premium 64 Bit
       #5

    So how would you do the reverse, make a "protected operating system file" unprotected so it shows up as normal?
    I have some mp3's that for some reason are not showing up in my music folder until I uncheck the "Hide protected operating system files" box.
    Any suggestions?
      My Computer


  6. Posts : 71,980
    64-bit Windows 11 Pro for Workstations
       #6

    Hello grande007, and welcome to Seven Forums.

    You can use the command below in a elevated command prompt to do so. :)

    attrib -S -H "Full Path of File with extension"

    Hope this helps,
    Shawn
      My Computer


  7. Posts : 122
    Windows 7 Home Premium 64bit SP1
       #7

    Brink said:
    attrib +s +h full folder path /S /D /L
    Hey there I just tried using this command and it will not work for some reason... I was trying to mark 3 folders as protected since they should be and it didn't work. Anything else I can try?
      My Computer


  8. Posts : 71,980
    64-bit Windows 11 Pro for Workstations
       #8

    Hello Radical,

    Did it give you an error message?

    Did you do this in an elevated command prompt?

    Hope this helps for now. :)
      My Computer


  9. Posts : 122
    Windows 7 Home Premium 64bit SP1
       #9

    Brink said:
    Hello Radical,

    Did it give you an error message?

    Did you do this in an elevated command prompt?

    Hope this helps for now. :)
    Yeah I used an elevated command prompt and it didn't give me an error... I typed them in exactly like this:

    attrib +s +h "C:\Recovery" /S /D /L
    attrib +s +h "C:\MSOCache" /S /D /L
    attrib +s +h "C:\NST" /S /D /L

    I also tried without quotes... it seems to take a while or something in command prompt because it never goes back to showing C:\Windows\system32> and so I have to close off command prompt and enter in the next full line.
      My Computer


  10. Posts : 71,980
    64-bit Windows 11 Pro for Workstations
       #10

    Usually it should only take a brief moment after each command before the prompt appears again.

    Do you have ownership and "full control" access rights of these folders and their content?
      My Computer


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:23.
Find Us