網(wǎng)管一般都使用軟件來(lái)實(shí)現(xiàn)對(duì)Win2000局域網(wǎng)的管理,本文將介紹用Win2000的命令模式結(jié)合批處理來(lái)實(shí)現(xiàn)批量分發(fā)文件和批量禁止服務(wù),大家可以根據(jù)自己的需要做相應(yīng)改動(dòng)。
1.批量分發(fā)文件目標(biāo):替換用戶(hù)HOSTS文件
方法1
for %%B in 123 do net use z //192.168.0.%%B/admin$/system32/DRIVERS/ETC ″admin密碼″ /useradministrator© d/hosts z/ /y&net use z /del /y
方法2
for %%B in 123 do net use //192.168.0.%%B/ipc$ ″admin密碼″ /useradministrator© d/hosts //192.168.0.%%B/admin$/system32/DRIVERS/ETC /y&net use //192.168.0.%%B/ipc$ /del
2.批量禁止用戶(hù)Messenger服務(wù)
for %%B in 123 do net use //192.168.0.%%B/ipc$ ″admin密碼″ /useradministrator&sc.exe //192.168.0.%%B stop Messenger&sc.exe //192.168.0.%%B config Messenger start= disabled&net use //192.168.0.%%B/ipc$ /del
說(shuō)明:上例是對(duì)IP為192.168.0.1~192.168.0.3的主機(jī)進(jìn)行操作,Command1和Command2用來(lái)分隔一個(gè)命令行中的多個(gè)命令。Cmd.exe 運(yùn)行第一個(gè)命令,然后運(yùn)行第二個(gè)命令。sc.exe命令可以實(shí)現(xiàn)設(shè)置服務(wù)啟動(dòng)或關(guān)閉,此文件可以在Win2000的system32目錄下找到。詳細(xì)幫助請(qǐng)查閱Win2000幫助,希望此文對(duì)大家有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選