几款经典批处理实例(Several classic batch processing examples)Several classic batch processing examples
Author: unknown article source: network click number: 453 update time: 2006-6-13 0:34:14
1. delete batch processing by default sharing of win2k/xp system
Here then save as ------------------------ cut.Bat or.Cmd file ---------------------------
@echo preparing to delete all the default shares.when ready press any key.
@pause
@echo off
Rem check parameters if NULL show usage.
If {%1}=={} goto: Usage
Rem code start.
Echo.
Echo ------------------------------------------------------
Echo.
Echo Now deleting all the default shares. Echo.
Net share%1$/delete
Net share%2$/delete
Net share%3$/delete
Net share%4$/delete
Net share%5$/delete
Net share%6$/delete
Net share%7$/delete
Net share%8$/delete
Net share%9$/delete
Net stop Server
Net start Server
Echo.
Echo All the shares have been deleteed Echo.
Echo ------------------------------------------------------
Echo.
Echo Now modify the registry to change the system default properties.
Echo.
Echo Now creating the registry file
Echo Windows Registry Editor Version 5.00> c:/
Echo
[HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanma nserver/parameters]>> c:/
Echo "AutoShareWks" =dword:00000000>> c:/
Echo "AutoShareServer" =dword:00000000>> c:/
Echo Nowing using the registry file to chang the system default properties.
Regedit /s c:/
Echo Deleting the temprotarily files.
Del c:/
Goto: END
: Usage
Echo.
Echo ------------------------------------------------------ Echo.
Echo A example for batch file
Echo [Use batch file to change the sysytem share properties.] Echo.
Echo Author:Ex4rch
EchoMail:********************:1672602
Echo.
Echo Error:Not enough parameters
Echo.
Echo Please enter the share disk you wanna delete
Echo.
Echo For instance, to delete the default shares:
Echo delshare C D E IPC admin print
Echo.
Echo If the disklable is not as C: D: E:, Please chang it youself.
Echo.
Echo example:
Echo If locak disklable are C: D: E: X: Y: Z:, you should chang the command into:
Echo delshare C D E X Y Z IPC admin print
Echo.
unknown怎么处理
Echo * * you can delete nine shares once in a useing * *
Echo.
Echo ------------------------------------------------------
Goto: EOF
: END
Echo.

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。