PDA

View Full Version : I.T. Peep got any kixtart guru's here?


Dagimp
April 10th, 2008, 01:57 PM
I've just started using this. Basically I'm trying to map network printers based upon department. All of my PC's are named by dept. For example accounting could be ACCT01, ACCT02 and so on.

So using kixtart I should be able to script out auto installation of the printer. The problem is my users move around to different departments and when they login nothing is setup for them.

If I can get this nailed down then it will be the last piece in the puzzle so EVERYTHING will be setup for them on any PC.

I'm using a centralized login script, tho not being handed out by the domain.

I took turbo Pascal and C++ in college but that was years ago and my only programing experience. I'm pretty handy with batch files tho.

So I think my sytax here is all fooked up.


--Begin KiX script--

;* Add printer by computer name


;* "- Deleting any printers present - "
;* $printer = DelTree("HKEY_CURRENT_USER\Printers\connections")

"- Setup printer for Office 01 - "

if instr("%computername%","LAPTOP")
if AddPrinterConnection("\\PrintServer01\PRINTER01") = 0
"Done"
$printer = SetDefaultPrinter("\\PrintServer01\PRINTER01")
Endif
else
"No Printer"
endif
?
--End KiX script--

Reading the manual right now, but I really dont want to learn the whole damn scripting of kixtart just for this simple task.

JeepWheelin02
April 10th, 2008, 02:01 PM
Why not use VBScript instead? I know nothing about kixtart, got a guy I work with that does but he works nights.

If it is anything like VB you will need a registry connection for your script though, in order to make the changes you are trying to make in the registry.

Dagimp
April 10th, 2008, 02:05 PM
Same problem with VB, dont know it either.

If I do go back college to update my skills its one of the first classes I'll take.

JeepWheelin02
April 10th, 2008, 02:13 PM
So you want it to be a script that will delete any current printers, and install the correct printer according to what the computer name is?
Wouldnt it be even easier just to install each printer for each section on those machines and not on the others, then when people log in thats the one they use?

I mean I could write the script you are looking for but why?

Dagimp
April 10th, 2008, 02:25 PM
So you want it to be a script that will delete any current printers, and install the correct printer according to what the computer name is?
Wouldnt it be even easier just to install each printer for each section on those machines and not on the others, then when people log in thats the one they use?

I mean I could write the script you are looking for but why?

That was a cut and past from some else demo script.

Not sure I want to delete the printer, more like a "if not exist then". I'd really like it to delete that stupid microsoft "image" printer tho.

Then add the printer based upon the first 6 characters of the PC name.

I could do this my login script but the DOS command
IF %computername%=="ACCT"
will return a false if the computer name is ACCT01.

Then make it the default printer.

Dagimp
April 10th, 2008, 04:36 PM
Got it done in Kixtart, pretty simple easy to use once you get the basic syntax town.