Jump to content

Get Printers/ Add Printers


Guest Doxie
 Share

Recommended Posts

Guest Doxie

Hi again,

I am working on a migration script, that i could use when one of my users need a new PC. This script will collect all data from the old one, and add to the new one.

But i have a small problem with printers.

Below you can see how i solved the network drives

*************Old PC**********************

;Get Drive

$Drives = DriveGetDrive ( "NETWORK" )

For $i = 0 To $Drives[0]

IniWrite ( $ini, "NetDrives", "Drive "&$i, $Drives[$i] )

*****************************************

*************New PC*********************

$test = IniRead ( $ini, "NetDrives", "Drive 0", 0)

For $i = 0 To $test

$get = IniRead ( $ini, "NetDrives", "Drive "&$i, 0)

Select

Case $get == "f:"

Run("net use f: \\Server\Share /y")

Case $get == "k:"

Run("net use k: \\Server\Share /y")

Case $get == "l:"

Run("net use l: \\Server\Share /y")

Case $get == "m:"

Run("net use m: \\Server\Share /y")

Case $get == "n:"

Run("net use n: \\Server\Share /y")

Case $get == "o:"

Run("net use o: \\Server\Share /y")

Case $get == "p:"

Run("net use p: \\xp2svr01\TD /y")

Case $get == "r:"

Run("net use r: \\Server\Share /y")

Case $get == "t:"

Run("net use t: \\Server\Share /y")

Case Else

EndSelect

*****************************************

Is ther anyway to make something similiar with Printers?

I made a bat file that is making something similar, but that add ALL network printers to everyone. It would be much better to check first, and just add printers used.

Thanks in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...