Sign in to follow this  
Followers 0
Guest Doxie

Get Printers/ Add Printers

2 posts in this topic

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)


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



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

Share this post

Link to post
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
Sign in to follow this  
Followers 0