Question

In: Computer Science

POWERSHELL Remember hidden administrative shares that are automatically created for all disk drives in Windows operating...

POWERSHELL

Remember hidden administrative shares that are automatically created for all disk drives in Windows operating systems (C$, D$, etc.)? These shares can be stopped and removed, but after the next reboot, the shares will reappear. There is a registry key that can be created to remove these permanently; refer to the Microsoft KB #954422 article for the appropriate registry key/value. Create a script that will:

A. Check if the registry key exists.

B. If the key exists, change the value to the appropriate value.

C. If the key does not exist, create the key and add the new value.

D. Insert screen feedback to inform the user of the progress of the script (use write-host).

Solutions

Expert Solution

Use msconfig and add the PowerShell script to startup, but I cannot find the PowerShell script on that list.

Create a shortcut and drop it to startup folder. No luck.

%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -File "C:\script.ps1"

or

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File "C:\script.ps1"

script.ps1
************

New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanManServer' -Name 'AutoShareWks' -PropertyType 'Dword' -Value 0

put above script.ps1 file in the c:\script\script.ps1 and add entry to the startup folder so each time when the computer start it will execute this script with administrator rights so it will set the registry value to 0 each time automatically.

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)


Related Solutions

hacking Embedded Operating Systems: The Hidden Threat EXPLAIN WINDOWS IoT (INTERNET OF THINGS) AND OTHER EMBEDDED...
hacking Embedded Operating Systems: The Hidden Threat EXPLAIN WINDOWS IoT (INTERNET OF THINGS) AND OTHER EMBEDDED SYSTEMS. WHAT ARE NIX EMBEDDED OPERATING SYSTEMS? HOW DO YOU PATCH EMBEDDED OPERATING SYSTEMS?.
Although 90% of all desktop computers use Windows as their operating system, there are two popular...
Although 90% of all desktop computers use Windows as their operating system, there are two popular alternatives - Apple's Mac OS and the Linux open-source operating system. In this assignment, you will investigate an operating system other than the one you usually use to see how it handles common operating system functions. Note: A popular Linux OS is Ubuntu (As an open-source operating system it is FREE). If you choose to test Linux you can use this link for easy...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT