Script
If user = admin Then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS3"
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS4"
net.AddWindowsPrinterConnection "\\dirennantes\hydrohp3200"
net.AddWindowsPrinterConnection "\\dirennantes\LXC910PCL2"
net.AddWindowsPrinterConnection "\\dirennantes\LXC910PCL5"
net.AddWindowsPrinterConnection "\\dirennantes\LXC912PCLSEMA"
net.AddWindowsPrinterConnection "\\dirennantes\LXW820PCLSEMA"
Else
Dim strComputerName
Dim WshShellObj
Dim WshProcessEnv
Dim WshComputername
Set WshShellObj = WScript.CreateObject("WScript.Shell" )
Set WshProcessEnv = WshShellObj.Environment("PROCESS" )
WshComputername = GetComputerName
Private Function GetComputerName()
Dim oNetwork
On Error Resume Next
Set oNetwork = CreateObject("WScript.Network" )
GetComputerName = oNetwork.ComputerName
Set oNetwork = Nothing
End Function
IF
(Mid(%computerName%, 1, 1) = S then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection "\\dirennantes\LXC912PCLSEMA"
net.AddWindowsPrinterConnection «\\dirennantes\LXW820PCLSEMA»
Else IF
(Mid(%computerName%, 1, 1) = H then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection \\dirennantes\hydrohp3200
net.AddWindowsPrinterConnection "\\dirennantes\faxhydro"
Else IF
(Mid(%computerName%, 0, 1) = P then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS3"
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS4"
net.AddWindowsPrinterConnection "\\dirennantes\hydrohp3200"
net.AddWindowsPrinterConnection "\\dirennantes\LXC910PCL2"
net.AddWindowsPrinterConnection "\\dirennantes\LXC910PCL5"
net.AddWindowsPrinterConnection "\\dirennantes\LXC912PCLSEMA"
net.AddWindowsPrinterConnection "\\dirennantes\LXW820PCLSEMA"
Else If
(Mid(%computerName%, 0, 1) = S then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS3"
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS4"
net.AddWindowsPrinterConnection "\\dirennantes\hydrohp3200"
net.AddWindowsPrinterConnection "\\dirennantes\LXC910PCL2"
net.AddWindowsPrinterConnection "\\dirennantes\LXC910PCL5"
net.AddWindowsPrinterConnection "\\dirennantes\LXC912PCLSEMA"
net.AddWindowsPrinterConnection "\\dirennantes\LXW820PCLSEMA"
else if
(Mid(%computerName%, 1, 2) = M2 then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection "\\dirennantes\LXC910PCL2"
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS3"
Else if
(Mid(%computerName%, 1, 2) = M3 then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection \\dirennantes\IR3100CPS4
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS3"
Else if
(Mid(%computerName%, 1, 2) = M4 then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection \\dirennantes\IR3100CPS4
net.AddWindowsPrinterConnection "\\dirennantes\IR3100CPS3"
Else if
(Mid(%computerName%, 1, 2) = M5 then
Dim net
Set net= CreateObject("WScript.Network" )
net.AddWindowsPrinterConnection \\dirennantes\IR3100CPS4
net.AddWindowsPrinterConnection \\dirennantes\LXC910PCL5
End if
End