[THIN] Re: Need scripting help

  • From: "TheThin" <TheThin@xxxxxxxxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Tue, 9 Mar 2004 16:55:04 -0500

You can enumerate printers to a file very easily via a dos command
script using the "rundll32.exe printui.dll,PrintUIEntry [options]
[@commandfile]" command.  Just shell to DOS in your kix script and drop
out a textfile from the rundll32.exe command with all the printers and
then use it for your logic.

I actually did something similar using all DOS by using the the Findstr
command in a script recently.  I had not used rundll32.exe previously
but it allows you to use objects from certain .dll files native to
windows.  The big plus is that if there is not an object in Kix or WSH a
lot of the time you can find an object in a .dll that does the job -
When I started reading about what Rundll32.exe can do, I pretty much
went "WOW, I didn't think DOS scripts could do that!". =20

Goto
http://www.dx21.com/SCRIPTING/RUNDLL32/ViewItem.ASP?OID=3D145&CMD=3DP%3DA=

to read about rundll32.exe usage.


-----Original Message-----
From: Andrew Rogers [mailto:Andrew.Rogers@xxxxxxxxxxxxxxxxxx]=20
Posted At: Monday, March 08, 2004 12:04 PM
Posted To: TheThin
Conversation: [THIN] Re: Need scripting help
Subject: [THIN] Re: Need scripting help


Dont know if it would work (initial thoughts say it should ;) ), but the
qu=3D ick and dirty way to do it would be to try and set the default
printer to b=3D e the one you want to delete, check for errors, if there
is one, its not th=3D ere to delete :)

Andrew
--o--

>>> Paul.Stansel@xxxxxxxxxxxxxxx 08/03/04 16:48:35 >>>
Ok, we have a Kix file that queries an ini file and maps user printers.
We're trying to clean up some old mappings, so I set a similar section
in the file using DelPrinterConnection.  Works like a champ, reads the
same lines and deletes the print mappings just fine.  The problem is
that I want logic to check if the printer actually exists before I go
through the process of deleting it.  If it doesn't exist, it pauses for
a while before continuing to process the next deletion.  The printer ini
file looks like
this:
=3D20

=3D20

[CBI]

NumberPrinter=3D3D1

printer1=3D3D\\AD2SIMPRT001\HLIEBHOHPL02

printer2=3D3D

printer3=3D3D

printer4=3D3D

=3D20

Is there a way to query the registry for the existence of that printer
before trying to delete it?  I was trying to use EnumValue and compare
it to a variable that is the printer name, but it was failing.  Just
looking for ideas.

=3D20

Thanks,

Paul



This communication, including attachments, is for the exclusive use
of=3D20 addressee and may contain proprietary, confidential or
privileged=3D20 information. If you are not the intended recipient, any
use, copying,=3D20 disclosure, dissemination or distribution is strictly
prohibited. If=3D20 you are not the intended recipient, please notify =
the
sender=3D20 immediately by return email and delete this communication =
and
destroy all c=3D opies.



********************************************************
This weeks sponsor triCerat Inc.
triCerat makes your job easier by offering essential applications to
eliminate your printing, policy and profile, and your application
management problems. http://www.triCerat.com=3D20
**********************************************************
Useful Thin Client Computing Links are available at:
http://thin.net/links.cfm=3D20
***********************************************************
For Archives, to Unsubscribe, Subscribe or=3D20
set Digest or Vacation mode use the below link:
http://thin.net/citrixlist.cfm

********************************************************
This weeks sponsor triCerat Inc.
triCerat makes your job easier by offering essential applications to
eliminate your printing, policy and profile, and your application
management problems. http://www.triCerat.com=20
**********************************************************
Useful Thin Client Computing Links are available at:
http://thin.net/links.cfm
***********************************************************
For Archives, to Unsubscribe, Subscribe or=20
set Digest or Vacation mode use the below link:
http://thin.net/citrixlist.cfm
********************************************************
This weeks sponsor triCerat Inc.
triCerat makes your job easier by offering essential
applications to eliminate your printing, policy and profile,
and your application management problems.
http://www.triCerat.com 
**********************************************************
Useful Thin Client Computing Links are available at:
http://thin.net/links.cfm
***********************************************************
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thin.net/citrixlist.cfm

Other related posts: