|
-
May 26th, 2007, 05:11 AM
#1
execute batch files in the "Run" command line in a VB code
Dear Sir,
How can I execute batch files on the "Run" command line in a VB code?
I have installed four printer in my computer:
1-Acrobat Distiller
2-Canon LBP-810
3-hp LaserJet 1320 PCL 6
4-Microsoft Office Document Image Writer
I have problem with using “SHRunDialog” Function during selection of my default printer from one of my four installed printer in my computer with my VB code.
I can not have any control in selecting default printer when I am trying to select “Canon LBP-810 “ printer or “hp LaserJet 1320 PCL 6” printer
by using “SHRunDialog” Function in my VB code.
I can not execute my favorite command : [rundll32 printui.dll,PrintUIEntry /y /n "hp LaserJet 1320 PCL 6"] in a new window and I can not define my favorite default printer by my VB code on the "Run" command line in a VB code.
Please inform me that How can I use “SHRunDialog” Function for selecting “Canon LBP-810” or “hp LaserJet 1320 PCL 6” or other favorite printers as default printer (depend on my request, from on of my four printers) by my VB code?
Sincerely
-
May 26th, 2007, 06:07 AM
#2
Re: execute batch files in the "Run" command line in a VB code
You can 'shell' command to execute your run command.
or you can use Windows Scripting Host Object for selecting the default printer on your machine.
or you can read it from windows registry.
Which one you want?
-
May 26th, 2007, 06:41 AM
#3
execute batch files in the "Run" command line in a VB code
Dear Friend ,
Can you instead of execute in the "Run" command line in a VB code the [rundll32 printui.dll,PrintUIEntry /y /n "hp LaserJet 1320 PCL 6"] this VB program ?
Private Sub Command1_Click()
Dim AA As String
Dim RetVal
AA = "hp LaserJet 1320 PCL 6"
RetVal = Shell("rundll32 printui.dll,PrintUIEntry /y /n AA", 3)
End Sub
If you can please inform me HOW?
I need a way for running [rundll32 printui.dll,PrintUIEntry /y /n "hp LaserJet 1320 PCL 6"] in the in the "Run" command with a VB code.
-
May 26th, 2007, 11:06 PM
#4
Re: execute batch files in the "Run" command line in a VB code
Hi Camelia, I just wanna to know that do u want to run your command from "Run Dialog box" or from VB Shell command?
Please clear it..!
BTW...Hi again!
I'M BACK AGAIN !!
-------------------------------------------------------------------------
enjoy the VB ! 
If any post helps you, please rate that.
Always try to findout the Solutions, instead just discussing the problem and its scope!

-
May 26th, 2007, 11:18 PM
#5
Re: execute batch files in the "Run" command line in a VB code
Hi .
Code:
dim NamePrinter as string
NamePrinter = """hp LaserJet 1320 PCL 6"""
RetVal = Shell("rundll32 printui.dll,PrintUIEntry /y /n " & NamePrinter , 3)
BTW:use tag code please.
-
May 27th, 2007, 03:24 AM
#6
Re: execute batch files in the "Run" command line in a VB code
Thank you very much. It is my solution.
Sincerely,
Camelia
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|