You can write-protect specific files, directories, and drives to prevent unauthorized programs or users from changing them.
Run this command at the command prompt.
sadmin write-protect [ -i ] pathname1 ... pathnameNPaths can include wildcard characters. When using wildcards, make sure that the specified string matches a limited set of file paths or file names. If the specified string matches many files, we recommend you revise the string.
Paths can include the * and ? wildcard characters. When specifying a file path,
C:\Test1\*\*\Test.text,C:\?Test*\Test1\Test.txtare allowed while*:\Test1\*\*\Test.txt,*\Test1\Test2\Test.txt, and*:\Test1\Test2\Test.txtare not allowed.
For example:
sadmin write-protect -i Listener.ora
You can also write-protect network file systems by specifying the network path with the
sadmin write-protectcommand to prevent any change to the network share.This table describes how you can specify the network path with the command.
Syntax
Example
sadmin write-protect –i \\server-name\share-nameSpecify the server name that has a network share. Also, specify the name of the network share. For example:
sadmin write-protect –i \\ftpserver\documentssadmin write-protect –i \\server-ip\share-nameSpecify the IP address of a server and name of the network share.
For example:
sadmin write-protect –i \\192.168.0.1\documentssadmin write-protect –i mapped-drive-letter:\Specify the drive letter, which is mapped to the server on the client system.
For example:
sadmin write-protect –i W:\You can write-protect registry keys.
sadmin write-protect-reg [ -i ] registrykeyname1 ... registrykeynameNPaths used in registry key-based rules can include the wildcard character (*). But, it can only represent one path component in the registry path. Don't use the character for the component at the end of the complete registry path (if used at the end, the path filter isn't in effect). For example, registry path
HKEY_LOCAL_MACHINE\*\Microsoftis allowed whileHKEY_LOCAL_MACHINE\*orHKEY_LOCAL_MACHINE\*\*isn't allowed.Tip
Write-protect only the
HKEY_LOCAL_MACHINE\SOFTWAREregistry key cluster to protect the Windows components. Do not write-protect other registry key clusters.Specify registry key names as parameters with the write-protect-reg (wpr) command to apply write protection to registry keys. For example:
sadmin write-protect-reg –i HKEY_LOCAL_MACHINE\SOFTWARE