In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how batch processing automatically detects all disks and then deletes the default sharing of all partitions. It has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
Delete default share.bat for all partitions
The code is as follows:
@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: First list the existing partitions, and then delete the shares named by the partition name one by one;
:: Prevent admin$sharing from reloading the next time it boots by modifying the registry;
:: IPC$share requires administrator privileges to successfully delete
::
:: jm Modified on May 12, 2006
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
title Default Share Deleter
echo.
echo ------------------------------------------------------
echo.
echo starts deleting default shares under each partition.
echo.
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @(
if exist %%a:\nul (
net share %%a$ /delete>nul 2>nul && echo Successfully deleted default share named %%a$||echo default share named %%a$does not exist
)
)
net share admin$ /delete>nul 2>nul && echo Successfully deleted default share named admin$||echo Default share named admin$does not exist
echo.
echo ------------------------------------------------------
echo.
net stop Server>nul 2>nul && echo Server service stopped.
net start Server>nul 2>nul && echo Server service started.
echo.
echo ------------------------------------------------------
echo.
echo Modify the registry to change system defaults.
echo.
echo Creating registry files.
echo Windows Registry Editor Version 5.00> c:\delshare.reg
:: Disable Admin$sharing via registry to prevent reloading after restart
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]>> c:\delshare.reg
echo "AutoShareWks"=dword:00000000>> c:\delshare.reg
echo "AutoShareServer"=dword:00000000>> c:\delshare.reg
:: Delete IPC$share. This function requires administrator permission to delete successfully.
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]>> c:\delshare.reg
echo "restrictanonymous"=dword:00000001>> c:\delshare.reg
echo Importing registry files to change system defaults.
regedit /s c:\delshare.reg
del c:\delshare.reg && echo Temporary file deleted.
echo.
echo ------------------------------------------------------
echo.
echo program has successfully deleted all default shares.
echo.
echo Press any key to exit...
pause>nul
Thank you for reading this article carefully. I hope that Xiaobian will share the article "How to realize automatic detection of all disks and then delete the default sharing of all partitions in batch processing". This article is helpful to everyone. At the same time, I hope that everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.