Group Policy: Prevent access to drives from MyComputer

NoViewOnDrive HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer Data type Range Default value REG_DWORD 0x0–0x3FFFFFF 0x0 Description Prevents users from using My Computer to access the content of selected drives. When a drive is represented in the value of this entry, users cannot view the contents of the selected drives in My Computer or in Windows Explorer. Also, they cannot use the Run dialog box, the Map Network Drive dialog box, or the Dir command to view the directories on these drives. This entry stores the setting of the Prevent access to drives from My Computer Group Policy. Group Policy adds this entry to the registry […]

Read more

PS: String/Text Replacement

PS supports a built-in string search and replacement operator named –replace. The -replace operator uses a regular expression to search-and-replace through a string. The default behavior is it does a case insensitive similar to that of using –ireplace.  For a case sensitiveness, you need to use –creplace. Default replace behavior: PS C:> $str = "This is a SAMPLE string" PS C:> write-host $Str This is a SAMPLE string PS C:> $str -replace "SAMple","Test" This is a Test string PS C:> write-host $Str This is a SAMPLE string PS C:> Explicit case-insensitive replacement: PS C:> write-host $Str This is a SAMPLE […]

Read more

Working With Command Processor/Prompt

AutoRun commands from cmd (Comand Prompt/Processor) Command processor runs all the cmd.exe launch commands in HKLM/HKCU ‘SoftwareMicrosoftCommand ProcessorAutoRun’ key.  C:>reg query "HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor" /V AutoRun HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor     AutoRun    REG_SZ    title admin && CD && cls C:> Launch Command Processor with instruction: cmd /k reg query "HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor" /V AutoRun

Read more