> Tech > listings

listings

Tech - Par Renaud ROSSET - Publié le 24 juin 2010
email

Listing 1 : Script pour se connecter à  une imprimante

A

Option Explicit
Dim oNetwork, sPrintPath

B

Set oNetwork = CreateObject("WScript.Network")

C
listings

SIZE= »1″>

sPrintPath = « \\servername\printername »

D

Network.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath

Listing 2 : Script pour créer une connexion d’imprimante propre à  un ordinateur


Option Explicit
Dim oNetwork, sPrintPath
Set oNetwork = CreateObject(« WScript.Network »)
Select Case oNetwork.ComputerName    A
  Case « Gamma »
   s PrintPath = « \\server\printer1 »
  Case « Geektoy »
    sPrintPath = « \\server\printer2 »
  Case Else
   sPrintPath = « \\server\printer3 »
End Select
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath

Listing 3 : Script pour créer une connexion d’imprimante
propre à  un endroit


Option Explicit
Dim oNetwork, sPrintPath, sLocate
Set oNetwork = CreateObject(« WScript.Network »)

sLocate =_   A
    InputBox(« Where are
you? Type ‘Lab’, ‘Library’, or ‘Reception’. »)
Select Case sLocate
  Case « Lab »
    sPrintPath = « \\server\printerA »
  Case « Library »
    sPrintPath = « \\server\printerB »
  Case « Reception »
    sPrintPath = « \\server\printerC »
  Case Else
    MsgBox(« That is not a valid choice. The script will
exit. ») :WScript.
End Select

oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath

Téléchargez cette ressource

Guide de technologie 5G pour l’entreprise

Guide de technologie 5G pour l’entreprise

Pourquoi la 5G est-elle faite pour votre entreprise ? La 5G peut améliorer la vitesse, la fiabilité et la capacité de votre réseau, permettant ainsi une meilleure collaboration, une productivité accrue et une prise de décision plus rapide. Notre livre blanc " The Big Book of Enterprise 5G" vous fournit les informations stratégiques dont vous avez besoin pour prendre des décisions éclairées et préparer votre entreprise à prospérer dans l'ère de la 5G. Cradlepoint, part of Ericsson est le leader mondial des solutions de réseau sans fil 4G LTE et 5G fournies via le cloud. Connectez vos employés, lieux et objets avec la 4G LTE et la 5G pour un WAN sans fil d'entreprise.

Tech - Par Renaud ROSSET - Publié le 24 juin 2010