I need a very strong drink.
Aug. 2nd, 2006 03:50 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
After a week and a half of effort, two days of which has been pretty well full-time, I have cracked one of the more niggling problems we have here.
The problem: Printers. When we ghost a lab, we basically have to have the printers installed for every lab in which that image will be installed, and since we just did a rationalisation of images (since we found that the Dell GX270, GX280 and GX620 images could be 'folded' together into one image with all appropriate drivers), this means that basically evey lab must be able to print to almost every other lab. Moreover, it means that when things change, we have to remember all the labs that the image will be used in and set it up accordingly. We don't always remember to do this, and whether the solution is to set up the printer on each of 32 machines, or to re-make the image and re-ghost the labs again, the extant solutions weren't pretty.
But now I don't have to do either of those things.
First: set up the printer on a machine. Any machine, really. Just so long as you have admin rights. Once the printer is set up as you desire it, say, \\smb\lw.192, then open regedit and export HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\,,smb,lw.192. You'll know the subtree when you see it, it just has s/\\/,/g in the subtree name. Name the export of this subtree to something like lw.192.reg.
Now edit a file called, say, add_192.cmd, and put the following in it (assuming that you have a HP LaserJet 4100 for the sake of example):
Then have a job in Ghost that transfers the two files to the client, say, to c:\, then executes add_192.cmd. You can't just get it to execute the commands one after the other, because ghost doesn't keep them in order, which sucks.
I also discovered that ghost (8.0 at least) has an interesting bug: when giving a path to a file which you want to download to a client, the path can't have spaces. It copes with the spaces fine, right to the point where it goes to copy them over, when it fails.
But, I have done the, well, not the impossible, but figuring out what the hell was going on (or not) with Microsoft's usual level of informative error messages ("The arguments are invalid", that's it), I feel I deserve a long drink of something pleasant and brain-cell-icidal.
The problem: Printers. When we ghost a lab, we basically have to have the printers installed for every lab in which that image will be installed, and since we just did a rationalisation of images (since we found that the Dell GX270, GX280 and GX620 images could be 'folded' together into one image with all appropriate drivers), this means that basically evey lab must be able to print to almost every other lab. Moreover, it means that when things change, we have to remember all the labs that the image will be used in and set it up accordingly. We don't always remember to do this, and whether the solution is to set up the printer on each of 32 machines, or to re-make the image and re-ghost the labs again, the extant solutions weren't pretty.
But now I don't have to do either of those things.
First: set up the printer on a machine. Any machine, really. Just so long as you have admin rights. Once the printer is set up as you desire it, say, \\smb\lw.192, then open regedit and export HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\,,smb,lw.192. You'll know the subtree when you see it, it just has s/\\/,/g in the subtree name. Name the export of this subtree to something like lw.192.reg.
Now edit a file called, say, add_192.cmd, and put the following in it (assuming that you have a HP LaserJet 4100 for the sake of example):
rem first, install the correct driver:
start /wait rundll32 printui.dll,PrintUIEntry /ia /m"HP LaserJet 4100 Series PS" /f%windir%\inf\ntprint.inf /u /q
rem second, apply the registry patch:
start /wait regedit /s c:\lw.192.reg
rem last, stop and start the print spool system:
start /wait sc stop spooler
start /wait sc start spooler
Then have a job in Ghost that transfers the two files to the client, say, to c:\, then executes add_192.cmd. You can't just get it to execute the commands one after the other, because ghost doesn't keep them in order, which sucks.
I also discovered that ghost (8.0 at least) has an interesting bug: when giving a path to a file which you want to download to a client, the path can't have spaces. It copes with the spaces fine, right to the point where it goes to copy them over, when it fails.
But, I have done the, well, not the impossible, but figuring out what the hell was going on (or not) with Microsoft's usual level of informative error messages ("The arguments are invalid", that's it), I feel I deserve a long drink of something pleasant and brain-cell-icidal.