Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Install Printer Driver

I'd like to install a printer driver as an addin for one of my programs.

I find problems in the installation.

In the install program (Wise9) I include the proper entries in the [Devices] and [PrinterPorts] sections of win.ini as I have in the original computer

However when installed in the destination computer the printer doesn't appear in the printer folder, or sometimes appears greyed showing a problem in installation.

Is it necessary to do anything else in the installation ?

Any idea ?

Thanks in advance

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Send Native Printer Language Codes To The Printer Driver?
how to send native printer language codes to the printer driver?

here some native printer language codes for testing

Epson FX Printer Codes:-
Printer Operation:

Decimal ASCII Description
7 BEL Beeper
17 DC1 Select printer
19 DC3 Deselect printer
14 SO Select double width for one line
15 SI Select condensed mode
18 DC2 Cancel condensed mode

how to pass these PCL codes to printer through VB programming for changing printer settings dynamically.
try to solve this problem.

KS Raju.

How To Install Inf Driver From A CD

I am trying to make VB app on a CD so that when the CD is VB application starts....and then I can click on a button and install a driver. The driver is one of those .inf files that normally you can right click on and then select "install".



Need Install/driver For VB4
I need to reinstall my VB4, and my setup disk for it has a file corrupted. Does anyone happen to have a copy of the VB4SETUP.INF file available, or if it is text based, know what's in it? It's keep me from reinstalling. If you have it, I would appreciate it being sent as an email attachment (zipped is ok) to me at


How Do I Install A Driver
Hi, just wondering how I can install or "register" a driver with windows, the drivers consist of a .dll and a .sys, I need them to install in the network protocols section (TCP/IP, NetBIOS, etc.) as though I had installed the driver using the interface that windows provides, the user needs no control of this.

Thanks in advance,


Anyone Know How To Make A Printer Driver? I Need One For My Receipt Printer...
I am currently trying to use the Generic / Text only driver but I can't use the code that the printer uses to do different things. I know the code works because when I did it by sending the info directly to the LPT1 port it will format the text the way I want. When I try to print it using Printer.Print it turns the commands into text. Is there a way to make a driver or something to just send text to the printer and not put anything else with it? I assume the printer driver is sending something else with it that is causing the problem.

***Other way I was thinking about to solve this problem. Is there a way to send code directly to a specific computers LPT1 port? So if the computers where on a network I can run code that will use an IP address or a computer name then send the info to the LPT1 Port.... I'm searching right now if you couldn't tell...

Trying To Install/Start/Stop A Driver
My software needs a Driver which is copied into the System32/Drivers folder. I found a compiled .exe where you type in the location of the driver and it will Install/Start/Stop the driver. I need to do this in VB6. Anyone have any leads?

Creating Visual Interface To Install Unknown Driver Using VB
I am assigned for a project ( I do not know the details yet) in which I have to write a program in Visual Basic that would create a Visual Interface to install an unknown driver with a USB port to be installed in a certain computer. I have no idea what it is or what it means. Can anyone give me any guidelines of where to start.

Printer Driver
I want to create an application which will communicate with printer directly not through drivers. i have commands of printers but i don't have any procedure how i can achieve this task. please help i am expert in VB6 & .Net.

Printer Driver?
is it possible to developed our own printer driver in any machines of printer? coz my dad has loss his printer driver...

Printer Driver
I need to make a printer driver which prints to file in text format.What is a way to make such driver in classic VB.
Inayat Azmi.

Printer Driver
halo guys,

I got problem when I tried to print out some report in windows2000,
I used the VB,Crystal report and Windows98 for my development system, and it was printed well in Win98.

and when I used in Win2000, all the setting was running out, like the font setting, the paper size.

What i find out is the printer driver for both OS is different, eventhough it was designed for the same printer.

The problem is especially when i used the datamax barcode printer.


Printer Driver
How do i check programmatically whether my machine has a printer driver installed and made as default??

Printer Driver
Is it possible to create a printer driver in VB?

Fax Printer Driver
ITtoolbox Portal for Visual Basic -

Hi everybody !!!

Do anybody kowns if there is an ACTIVEX or OCX that allow
to create a .TIFF file image from an print file ?

I mean, suppose that I'm looking to a .DOC file with the MSWord
and I click on Print and I choose a Print Driver that is a Fax Printer
but that Fax print don't send a Fax only create the .TIF file.

Please, anybody could help me


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~

Printer Driver
I need to make a printer driver which prints to file in text format.What is a way to make such driver in using classic VB 6.0.
Inayat Azmi.

Printer Driver - The New Case
Hi guys,

I had some problem w/ my Printer Driver. It has some special properties i.e : 4 orientation (portrait, portrait 180 deg, landscape, landscape 180 deg), preset name (save the settings into a preset and we can call the preset name to retrieve the setting we want), mirror and negative printing, etc etc...

I search this forum but can't find the tool to see what is the printer driver had instore. I think I know the tool is DocumentProperties but all the samples were talking about save into DEVMODE. But DEVMODE had limited "properties", right ? For orientation, it only had 1 or 2.

Anybody know, how to display or capture all the properties inside that printer driver ?

Thanks in advance for any help.....


Printer Driver Problem
i have to print something using different printers. I'm using the CommonDialog to choose and set the printer. Everything is ok, but with one printer i have some problems.

When i choose another paper format (A3, for example) the printer prints still on A4. The printer properties are still the same, before and after the dialog! MS Word does it, my app doesn't...
I have tried everything Microsoft says about "VB" and "printer", but nothing works!

Is there any way to get the settings made in the dialog? I have tried to do it with the API, but the "PrinterProperties" function only shows one page of the printer dialog (i don't know why, M$ just tells that it is like it is...) so i can't make any settings...

There must be a way...?!


Printer Driver = Winspool, PLEASE HELP!
My developing environment is as follow:
Window 2000 Professional
Visual Basic 6.0 with service pact 5
Crystal Report 9.0

Here are part of my program for printing out the report

Dim prt As Printer

For Each prt In Printers
If prt.DeviceName = "HP LaserJet 4/4M Plus PS 600" Then
Set Printer = prt
Report.SelectPrinter prt.DriverName, prt.DeviceName, prt.Port
Exit For
End If


I am using the above codes to call the SelectPrinter function, but what I get for prt.DriverName is "winspool". Connection error occured as a result. Any idea how can I get the real name for my printer driver?

Please help!

Printer Driver Settings

I am coding a label printing system and i need the ability to change some of the advanced settings within a print driver. The driver i am using is at I am using the TEC-472 driver (not that it should matter).

The print driver has advanced printing settings such as print density and feed adjustment.

I need to retrieve and store this data (but don't need to modify it).

Query Regarding Printer Driver

I am working on a UNIDRV printer driver using Microsoft plug-ins
I have some queries:

1.If my application sends any True type fonts first I want to convert it to
a “Device font ” then I want to pass it to spooler.

2.How can I do this font substitution and which module I have to do this.

3.Example: if I printed anything in Times new roman font then I would like
to convert it to Draft or prestige...

Please give a hint to achieve this

Shankar B.

Delete Printer By Driver
Alright, here's what I'm faced with, and I'm not a VB coder (I'm the guy who does PHP and some C++, so VB is quite a new ballgame for me; not even sure this is in the right part of the forum!).

What I have is a very large network environment where we are replacing some proprietary software, and it requires reinstallation of existing printers/drivers/ports. The existing installation of the printers is using the "Generic / Text Only" driver. So I figured it wouldn't be difficult, using prnadmin.dll, to delete the printer based on it's driver. (These systems only have one "Generic / Text Only" printer installed also).

So here's what I did, and it failed, and I don't know why. It is based off the code found here (link)

dim oMaster
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
set oPrinter = CreateObject("Printer.Printer.1")
oPrinter.DriverName = "Generic / Text Only"
oMaster.PrinterDel oPrinter
That comes up with a context error, so I figured you had to specify it by the PrinterName property. Now in prnadmin.dll tools pack, there is a vbs script called prnmgr.vbs that will list all printers on yours system, so I attempted to modify that method, and it failed miserably (download dll and vbs scripts here)

dim oMaster
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
for each oPrinter in oMaster.Printers("")
if oPrinter.DriverName = "Generic / Text Only" then
oMaster.PrinterDel oPrinter
end if
That does nothing. However, it's almost identical to the code in the prnmgr.vbs script. I replaced the if statement to display the DriverName and it doesn't display anything.

There's gotta be a way to do this, I'm just not a VB programmer to find it. Any help?

You guys have always been great here! Thanks in advance!

PS: Here is the ListPrinters code from the prnmgr.vbs script:

function ListPrinters(strServer)

on error resume next

DebugPrint kDebugTrace, "In ListPrinter"

dim oMaster
dim oPrinter
dim iRetval

set oMaster = CreateObject("PrintMaster.PrintMaster.1")

for each oPrinter in oMaster.Printers(strServer)

if Err.Number = kErrorSuccess then

wscript.echo ""
wscript.echo "ServerName : " & oPrinter.ServerName
wscript.echo "PrinterName : " & oPrinter.PrinterName
wscript.echo "ShareName : " & oPrinter.ShareName
wscript.echo "DriverName : " & oPrinter.DriverName
wscript.echo "PortName : " & oPrinter.PortName
wscript.echo "Comment : " & oPrinter.Comment
wscript.echo "Location : " & oPrinter.Location
wscript.echo "SepFile : " & oPrinter.SepFile
wscript.echo "PrintProcesor : " & oPrinter.PrintProcessor
wscript.echo "DataType : " & oPrinter.DataType
wscript.echo "Parameters : " & oPrinter.Parameters
wscript.echo "Attributes : " & CSTR(oPrinter.Attributes)
wscript.echo "Priority : " & CSTR(oPrinter.Priority)
wscript.echo "DefaultPriority : " & CStr(oPrinter.DefaultPriority)
wscript.echo "StartTime : " & CStr(oPrinter.StartTime)
wscript.echo "UntilTime : " & CStr(oPrinter.UntilTime)
wscript.echo "Status : " & CStr(oPrinter.Status)
wscript.echo "Jobc Count : " & CStr(oPrinter.Jobs)
wscript.echo "AveragePPM : " & CStr(oPrinter.AveragePPM)



wscript.echo "Unable to list printers, error: 0x" & _
Hex(Err.Number) & ". " & Err.Description

ListPrinters = kErrorFailure

exit function

end if


wscript.echo "Success listing printers"

ListPrinters = kErrorSuccess

end function

Free .pdf Printer Driver

can anybody tell me where i can download free pdf printer driver?

Retriving Printer Driver
How do i get the printer driver name.
I tried using the common dialog, but the printer driver name is not the same, compared with the printer's driver name in the test printout.

Please advice.
Thanks and Regards,
wong kah siang

Printer Driver Settings

Many printer drivers come with some settings available (as in Properties of that printer). Is it possible to access / change those settings within a VB program?


How To Write A Fax Printer Driver

I want to write a fax printer driver that works in any windows.
Please Help me!

Need To Develop Printer Driver
Hi friends,
I want to develop a printer driver for my company . so i wanted to know if it is possible to develop the driver in vb 6.
I searched on net but could not find any useful links
If any one can plz help


Create A Printer Driver
Does anyone know of any tutorial anywhere on the web that shows how to create printer drivers in VB?


Interface With Printer Driver
Is there a dll component I can add to my VB program so I can interface to the Eltron printer?
If someone could direct me to sample code, I'd appreciate it.
(I have to print a label and encode a SS# to a magnetic strip of a card.)
I installed the printer driver w/o any problem.

Get Printer Driver Directory
I am in need of help pls hep me if u can
i am trying to get the printer driver directory
but i am unable to get the desire result
i am using the API
and the Expected result is
pls help me

Create Printer Driver
I'm doing a project where Machine A sends (prints out from printer) out a printout to machine B and machine B will read the printout and stores in database before sending to printer.

I would want to create the simplest printer driver without word wrap... Is that possible in vb? or if not then how to in VC++.

Does anybody knows any printer driver that does not have the function of word wrap at all. I tried using generic printer but it word wraps my document...

Thanks in advance


Windows 98 Se Printer Driver Update
I lost my Windows 98 se CD and when I try to load a new printer into the system it will not add it at all! I even tried downloading off the internet the setup files for each printer still requires and asks for the Windows 98 se CD. What can I do? Anybody have downloads off the internet that would help?

Printer Driver Customization Needed

I have purchased a POS printer (Receipt) from Tawain, and I found that it doesn't support an arabic fonts, & I need it into my application. So, is there a way I can type in it an arabic (generating report) & are you familiar to do me a customized device driver for this printer,as I see it is the only solution that I have till now, any suggestion it will be helpful....

I am in hurry of that...

Ahmad Hassouna
Project Manager

Generic Text-only Printer Driver

I've got a strange problem with the generic text-only printer driver under WinXP SP1. The output is garbled, strings are printed at bad places. The same code works fine with the same printer and generic text-only driver under Win95 OSR2. Seems to me that there is a problem with the driver. Have anybody heard rumours about such problems and how to solve them? Thanks.

Post Script Printer Driver
Can anybody tell me what a post script print driver is and where can i get this? thanks..

Can Someone Tell Me How To Find Printer Default Driver
Can someone tell me how to find printer default driver?


Printer Driver Deployment Via Web Page
Has anyone heard of an app that will alloy you to deploy printer drivers through a web link?

Is it possible to create such an application?


Creating Software-printer Driver
All I want is to display a preview before printing.

I would be satisfied with a software printer (such as FAX services etc.) using form- or picturebox's hDC instead of paper.

Extra Printer Driver Properties
I use an Api function Printdlg for the access to the printer properties. It sets the DEVMODE structure that I use for setting the properties of the Printer object. These properties are standard but some printers have an extended settings. How to set these properties to the printer object? There is a dmDriverExtra variable in the DEVMODE structure. It is the number of bytes followed this structure for driver private data. Are these date the extended properties?

thanks for help

Register As Printer/Print Driver
This may be more of a general question and not necessarily strictly a VB thing, but I was wondering how one would register a custom dll or program written in VB as a printer, the goal being that the user could open say a web page in IE, choose print, and select this registered dll as the printer destination at which point the dll would be instantiated and do its thing. Any way to do this? Thanks!

Create A Custom Printer Driver
From any standard Windows application (including Notepad), I need to perform a SaveAs procedure (to a nominated folder) and also request the input of some text info (to be saved as a separate text file). I can do all this easily by writing a bit of code using VB6.

My problem is …. I think the best way to initiate this process is to access a custom-written Printer driver (FILE / PRINT dropdown menu’s are common to all Windows apps). Any idea how I can create / install my own “Printer Driver” or does anyone know of a better way?

I found a reference to a product called pdfFactory on the FinePrint website that would save the file to a PDF format (which would be useful) but it does not appear to give me the option to create the text info i require.


Enumerate Printer Port Driver Then CREATEFILE
I need to enumerate the printer portdevice driver then use CREATEFILE to connect to this port and then use WRITEFILE & READFILE to write & read to the printer. I'm a little lost in doing this.
I have got this so far:

Public Declare Function EnumPorts Lib "winspool.drv" _
Alias "EnumPortsA" _
(ByVal pName As String, _
ByVal nLevel As Long, _
lpbPorts As Any, _
ByVal cbBuf As Long, _
pcbNeeded As Long, _
pcReturned As Long) As Long

Public Type PORT_INFO
pPortName As Long
pMonitorName As Long
pDescription As Long
fPortType As Long
Reserved As Long
End Type

Dim pcbNeeded As Long
Dim pcReturned As Long
Dim i as integer
Dim SelectedPrinter() As PORT_INFO
Call EnumPorts(vbNullString, 2, 0, 0, pcbNeeded, pcReturned)
ReDim SelectedPrinter((pcbNeeded / SIZEOFPORT_INFO))

EnumPorts(vbNullString, 2, SelectedPrinter(0), pcbNeeded, pcbNeeded, pcReturned)

do until i pcReturned
i = i + 1
If GetStrFromPtrA(SelectedPrinter(i).pPortName) = "Printer USB001:" Then
MsgBox "Found the printer I'm looking for"
End If

'Some how find connect to printer device driver.

'Then use the normal


lWritten = WriteFile(lHandle, ByVal Data, lBytesToWrite, lBytesWritten, 0)

lBytesToRead = FileLen(FileName)
ReDim bytArr(lBytesToRead) As Byte

lRead = ReadFile(lHandle, bytArr(0), lBytesToRead, lBytesRead, 0)

CloseHandle lHandle

Thanks for any help

Hooking Into The Printer Properties At The Driver Level
Anyone know of a way to hook into the Printer Properties dialog at the driver level thru vb?

I have a Sony printer that doing the standard PrinterProperties call just flashes a screen and disappears... Not good. When I do the same thing for other printers, their dialogs display without any problems ...

I know, I know ... Call Sony and plead for some help ...

But, in the mean time?


How Do I Make Dot Matrix Printer Driver For Win Vista
I have a okidata microline 182 Turbo printer and I need the diver for winxp
Need to make one for it to work in windows vista

Generic Printer Driver With Data Report
hi pips.. ive installed a generic printer driver (generic / text only driver which is included in the windows OS)with the aim of having a fast printing output in my reports using datareport since it prints in a bidirectional manner.. ive achieved my aim.. (thanks to vbforums!) however my problem is the alingment of my report.. some of the fields are misaligned.. when i try to preview my report (e.g. it is perfectly aligned but when i print it some are misaligned.. please help.. tnx!

Opening A Database From Printer Driver Launced App
I have a application that opens a database file from the local hard drive and a network drive. This application is launched via a printer driver. (like a fax driver). The problem that I am having is the local database opens file but the network database does not. If I copy the network dbase from to a local drive and point to it it will open!. This is windows NT and seems to be a permission problem on the app.

here is the code
Dim gMainDb As Database
Dim gblTransDb As Database

Set gblTransDb = OpenDatabase("C:Trans.MDB") <- OPENS OK
Set gMainDb = OpenDatabase("F:MAIN_DB.MDB") <- This one FAILS

The error I get is #3051 (The Microsoft Jet database engine cannot open the file <name>. It is already opened exclusively by another user, or you need permission to view its data. (Error 3051))

Does anyone know how I can make the program use the security attributes of a normal app or the logged in user?


Retrieve Printer Model And Driver Type And Version
Hi all,

Is it possible to find (using VB code) the model and the driver type and version of the printers installed on a system running Win2k, XP, or 2003 server? I can get the printer names, but that's not enough; I need the details mentioned above.


Automatically Selecting The Correct Printer (print Driver)
How do you automatically select a defined printer before you perform a "printreport" ?

For example:

If I have a sales report that I always want printed on a printer called "Printronix P5000"... How would I programatically select that printer for the report ?

Thanks in advance for any help !!!!

PostScript Printer Driver Installation Problem In Windows Vista
For my VB application I am using PostScript Printer. And while installing Postscript Printer Driver on Windows Vista getting Error message as:

"Operation Could not be completer(error 0x00000705)Windows Cant locate suitable printer Driver."
I am using following command to install printer.

rundll32 printui.dll,PrintUIEntry /if /b "PrinterName" /f %windir%inf
tprint.inf /r "FILE:" /m "XPrint 4920/4925 PostScript"

The printer installation works file on Windiows XP.

Thanks in advanve

Display The Printer Driver Dialog Box Using Windows APi To Change Defaults
I want to replace the windows common dialog control and use windows api for the selecting of a printer and changing the default settings of the driver and having the changes applied to the printer when the print job is sent. We have stapling and many other options that the cmd command does not seem to support, so I think I need windows api commans to do what I am wanting. Alos, could someone please attach a copy of the win32api.txt file from VB6. I do not have the file.

Copyright © 2005-08, All rights reserved