2
2
I have an XP machine with multiple profiles. These profiles sometimes have different printers mapped to each user. Example:
- User A has network printer 1, 2 and 5 mapped. Printer 2 is default.
- User B has network printer 1, 4 and 8 mapped. Printer 4 is default.
- User C has network printer 2 mapped. Printer 2 is default.
My ideal would be to poll each and every user on the machine, list all the printers they have mapped, and then strip out the duplicates so that I have a list of unique printers mapped to the machine. Ideally I'd like to see which was defaulted most often, but that's totally optional. The list then would look like:
Machine.Old
- Printer 1
- Printer 2 [Defaulted most often]
- Printer 4
- Printer 5
- Printer 8
I would then like to restore the entire list of printers to each user on their new machine. They are migrating to a new windows 7 machine.
I've figured out how to do this for single user machines, with the following code:
Echo exporting printers
reg export HKCU\Printers\Connections %~d0\%username%\printers.reg
net use >%~d0\%username%\mappings.txt
Echo Importing Printers
reg import %~d0\%username%\printers.reg
The problem is that this works for only one user. I have an admin account, and I would like to get this to work all at once for a multiprofile machine.
Can't you just repeat what you have for a single user for all the user subfolders in
C:\Documents and Settings
? You might want to leave certain harcoded ones out, though, such as Guest. – martineau – 2012-12-11T17:54:49.360In the restore I can do that, although it would be nice to get all of them mapped at once. It's mainly the backup that's the problem. I need all the users to have all the printers, and sometimes a user that rarely logged onto this machine might have no printers mapped when they will need some. – Wyko – 2012-12-11T18:13:12.723