Wednesday, September 23, 2009

New ways to access the print wizard

Ever been working on a machine that's been locked down and restricted from controlling the printer settings?  It can be a real pain to have to log out and log back in as another user to change settings.  You can work around these restrictions by combining the RUNAS command with PRINTUI.DLL and the RUNDLL32.


You can get into the inner workings of PRINTUI.DLL to see exactly what you can do with a peek at the help screen:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /?


You can check out Rob Van der Woude's page at http://www.robvanderwoude.com/2kprintcontrol.php for a little more detail on the workings.  He also mentions a few VBS files (%windir%\System32\*prn*.vbs) that come with Windows XP that can also help when working with printers.  I've seen them, looked through them, played with them, but never tried to use them so I cannot say as to whether or not they would help on a locked down machine.  But, I have successfully used RUNAS with the PRINTUI.DLL to work with printers on a locked down machine.

Monday, September 14, 2009

Has Google Update got you down?

Anyone out there struggling to save bandwidth?  How about trying to keep your machines to a software level standard?  I came across this info the other day and I thought that it might help.  It lets you utilize Windows Group Policy settings to keep your Google Update in check.  You can use them to control scheduling, disable them all together and have better control over the installation.  


Sorry for the short post, but it's all pretty self explanatory.


Here's the link to actual documentation 
http://www.google.com/support/installer/bin/answer.py?hl=en&answer=146164

Saturday, September 5, 2009

Ringing the Bells

Recently we found our selves with a few classrooms that were not connected to the main bell system.  A classroom full of kids watching the clock like a hawk isn't the best thing in the world.  The few precious minutes of class time that is available doesn't need to be wasted clock watching, so they came to us in technology and asked if we could come up with a solution (cheaply).  My knee-jerk reaction was, "Get them all alarm clocks."  After that passed and I thought about it for a minute, an alarm clock didn't sound like a bad idea.  Why not turn the computers in the classrooms into alarm clocks.  They're old and slow, but they do keep time and will play sound.


We (in technology) tried to come up with an idea of exactly what we needed.  Then we set out across the internet looking for the solution.  We needed something that was cheap (free would be best), easy to use, allowed setting multiple alarms, and wrote the alarm settings to some kind of configuration file that we could easily push to the computers.  We found a lot of programs, some of the teachers even pitched in with suggestions, but we couldn't find anything that was a good fit.


Then the old reliable "Scheduled Tasks" came to the rescue.  It was free (comes with Windows), could be easily programmed with a batch file, could run as many alarms as we wanted, and the batch file was an easy way to set the schedule.  For any of you that don't know.  There's a way to set scheduled tasks through the command line, just run "SCHTASKS".  The built help is great and it takes just a few minutes to figure out what it takes to make the bell ring.  Well, it took just a few minutes to figure out that scheduled tasks doesn't include anything to make a sound.  That's ok, we're on a Windows box and we still have the trusty "Sound Recorder" program.  Now we've got the solution, Scheduled Tasks to watch the clock, Sound Recorder to play the sound, and a single batch file to set it all up.


The batch file we used is pretty simple.  Each bell ring gets created by a single command and we just copy that command over and over adjusting the times until we've got all the bell rings covered.  The command looks something like this:

SCHTASKS /create /tn BELL_8_00 /tr "sndrec.exe /play C:\Windows\Media\ding.wav /close" /D MON, TUE, WED, THU, FRI /ST 08:00


That command creates a schedule task that's named BELL_8_00, runs at 8:00AM, silently launches Sound Recorder, plays, ding.wav, automatically closes and runs Monday thru Friday.  Just rinse and repeat with the times for each bell ring that you need.  You can pick any wav file that you know is on the computers.  The key to making it play and close cleanly is the "/play" and "/close" switches on the sndrec.exe file.  


When it comes time to clean this up, it's much simpler command:


SCHTASKS /delete /tn BELL_8_00 /f


The /f forces the command to run, no prompts, no warning, it just deletes the tasks.  Rinse and repeat for each time.


This isn't a perfect solution, there are some draw backs, but it fit our requirements for the time. One problem is that it only allows for on schedule, unless you setup multiple batch files and make sure the teachers get the right ones.  It also doesn't account for activity schedules that occur at random times (like pep rallys or school plays).  And unless the teacher knows about configuring schedule tasks it doesn't give him/her many configuration options.  One solution might be to make a pretty wrapper with AutoIT or VBScript/HTA to allow for customization.  


Another idea that I had is a small program that watches for bell ringing commands from another computer so you can change and adjust the schedules in one spot.  That way each PC is sitting on the network ready to ring at any minute.  I was thinking a small stripped down XMPP client for each PC and a bigger XMPP bot that does the ringing and gets his ring schedule from a GUI that's configured by someone in the office.  That's going to be a project for my spare time.