@echo off
@echo Scripted by Jimmy Fei, 2007-10-30
@echo Connecting Network Drives ...
@net use * /delete /y
@net use x: \\192。168。0。1\groups /y
@net use y: \\192。168。0。2\groups /y
@net use z: \\192。168。0。3\groups /y
@echo Done
rem
rem Show Drive Mappings ...
@net use
@echo Done
rem Logon script complete
@echo Logon Script successfully completed作者: jaffas1101 时间: 2007-10-31 14:23
很好!!!
多谢分享!!!作者: chuqiao8250 时间: 2007-12-24 16:38
太简单了,我给大家看一个 可以根据不同的ou来映射作者: feitianxiang 时间: 2007-12-25 20:21
麻烦楼上把你的分享给大家,谢谢!作者: chuqiao8250 时间: 2007-12-26 18:19
我发到你邮箱作者: leemars8080 时间: 2007-12-28 12:30
楼上的太不厚到了,好东西不给大家看.
请看我这边的脚本,登陆不同的地方添加不同地方的打印机
在其中我把各地方装有打印机的服务器名字改成server1---5,没办法,不能泄露,万一被别人黑了怎么办,哈哈
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each observer5apter in colAdapters
If Not IsNull(observer5apter.IPAddress) Then
For i = 0 To UBound(observer5apter.IPAddress)
if left(observer5apter.IPAddress(i),10)="192.168.0." then loc="MC"
if left(observer5apter.IPAddress(i),10)="192.168.10" then loc="DU"
if left(observer5apter.IPAddress(i),10)="192.168.40" then loc="BA"
if left(observer5apter.IPAddress(i),10)="192.168.50" then loc="LD"
if left(observer5apter.IPAddress(i),10)="192.172.0." then loc="SH"
Next
End If
Next
'WScript.Echo "Location is " & loc
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery ("Select * from Win32_Printer where Network = 1")
For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next
dim wshnetwork
if loc = "MC" Then
set wshnetwork=wscript.createobject("wscript.network")
wshnetwork.addwindowsprinterconnection "\\server1\Xerox DC240 Black"
wshnetwork.setdefaultprinter "\\server1\Xerox DC240 Black"
wshnetwork.addwindowsprinterconnection "\\server1\Xerox DC240 Color"
wshnetwork.addwindowsprinterconnection "\\server1\Canon iR3100 Black"
wshnetwork.addwindowsprinterconnection "\\server1\Canon iR3100 Color"
wshnetwork.addwindowsprinterconnection "\\server1\HPLJ2600B"
wshnetwork.addwindowsprinterconnection "\\server1\HPLJ2600C"
end If
if loc = "DU" Then
set wshnetwork=wscript.createobject("wscript.network")
wshnetwork.addwindowsprinterconnection "\\server2\XeroxPro35"
wshnetwork.setdefaultprinter "\\server2\XeroxPro35"
wshnetwork.addwindowsprinterconnection "\\server2\XeroxPhaser"
end If
if loc = "BA" Then
set wshnetwork=wscript.createobject("wscript.network")
wshnetwork.addwindowsprinterconnection "\\server3\Canon2200B"
wshnetwork.setdefaultprinter "\\server3\Canon2200B"
wshnetwork.addwindowsprinterconnection "\\server3\Canon2200F"
end If
if loc = "LD" Then
set wshnetwork=wscript.createobject("wscript.network")
wshnetwork.addwindowsprinterconnection "\\server4\XeroxPro45"
wshnetwork.setdefaultprinter "\\server4\XeroxPro45"
end If
if loc = "SH" Then
set wshnetwork=wscript.createobject("wscript.network")
wshnetwork.addwindowsprinterconnection "\\server5\xerox"
wshnetwork.setdefaultprinter "\\server5\xerox"
wshnetwork.addwindowsprinterconnection "\\server5\ricoh"
wshnetwork.addwindowsprinterconnection "\\server5\kyocera"
end If作者: nickren 时间: 2008-1-4 11:51
强贴。希望能有更多的脚本出现。
比如说:关机自动从网络上某一台电脑中copy文件到本机的脚本。作者: pater 时间: 2008-1-4 14:39
買一個軟體了了。。。騰龍備份大師,,,,全搞定啊。。。作者: feitianxiang 时间: 2008-1-4 19:20
不错,感谢把好东西和大家分享作者: langzixin520 时间: 2008-3-5 15:38
如果没有那么多的网段该怎么样来分呢????