home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1724
Discussions: 188,402, Posts: 2,243,609, Members: 232,632
Old September 28th, 2005, 09:57 AM   Digg it!   #1 (permalink)
Member
 
Join Date: Jan 2004
Posts: 242
using a python script to install a printer

Hey, im trying to install a printer using a python script. I actually have it working and it does install, but i am using a very very slow working os.popen script:
Code:
os[dot]popen(<windir section>\\system32\\rundll32.exe printui.dll,<PrintUIEntry> /if /b \"%s\" /f windir_section\inf\ntprint.inf /r \"\\\<print server location here>\\<printer name>\" /m \"%s\" /u /z" % (cmd, Printer_Description, Driver_Name))
This part of the code works, but it looks like it freezes my program due to taking too long. I have tried to look into python modules that can do this for me..I found a possibility of using a win32com module based on an M$ site: http://www.microsoft.com/technet/scr.../prpopy01.mspx

I hear that the win32com modules are security risks due to the ActiveX/ActiveState? scripts...should I avoid using this library?
Thanks

edit: wonder why its pulling up that weird tag in the recent discussion box...


Last edited by engineuity : September 28th, 2005 at 10:44 AM.
engineuity is offline   Reply With Quote
Old September 28th, 2005, 10:10 AM     #2 (permalink)
Ultimate Member
 
Join Date: Aug 2004
Location: Lancaster, PA
Posts: 1,550
Send a message via AIM to JimRune Send a message via MSN to JimRune
The tag just keeps getting worse.
__________________
This is a +10 Post of Awesomeness. It is impervious to rebuttal, factual inaccuracies, and logical inconsistencies. Opinions expressed are 100% truth.

JimRune is offline   Reply With Quote
Old September 28th, 2005, 10:15 AM     #3 (permalink)
Member
 
Join Date: Jan 2004
Posts: 242
i know...i tried taking out the [code] tags and putting <> around the whole thing (the <windir> "phrase" is hidden from there), tried html comment <!-- --> and // ...

engineuity is offline   Reply With Quote
Old September 28th, 2005, 10:21 AM     #4 (permalink)
Member
 
Join Date: Jan 2004
Posts: 242
ok i give up on trying to fix that...the code looks mangled now, but the recent discussions look better. lol
engineuity is offline   Reply With Quote
Old October 4th, 2005, 10:59 AM     #5 (permalink)
Member
 
Join Date: Jan 2004
Posts: 242
bump...

nobody has any suggestions?
engineuity is offline   Reply With Quote
Old October 5th, 2005, 10:33 AM     #6 (permalink)
Member
 
Join Date: Jan 2004
Posts: 242
...just in case

instead of using os.popen, there is a win32print library that can be used in python:
Code:
win32print.AddPrinterConnection(\\<server>\<printer>)
Does anyone know how to use win32print.EnumPrinters?
engineuity is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant install printer. Nirrad Technical Support 9 August 28th, 2005 12:29 AM
Remote Printer Driver install on Citrix T Calvo Technical Support 4 September 15th, 2004 11:26 AM
WIN XP "page script" error when attempting to install new software Evilsxtasy Applications and Operating Systems 3 August 11th, 2003 01:13 PM
install a printer on redhat 8 dar1again Applications and Operating Systems 4 December 10th, 2002 10:17 PM
Automated Kernel Install script SpookyEddy Applications and Operating Systems 2 February 1st, 2002 03:15 PM

Most Active Discussions
Is It Just Me? (2906)
3-days in and no threads about Gaza (161)
Misery Loves Company... (2144)
New Build ( Finally ) (7)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
RCA 52Inch HDTV wont turn on (5)
Folderchat Weekday thread (444)
Recent Discussions
Futronix has water features? (0)
Laptop proccesor to desktop mob.. (2)
Please help! multiple problems! (4)
RCA 52Inch HDTV wont turn on (5)
New Build ( Finally ) (7)
Common Spyware Solutions (97)
How do you move a hard-drive to.. (4)
What is the best external enclo.. (0)
Partition Magic 7.0 (Unallocate.. (17)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 04:47 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28