Drucker aus meinem Gastsystem im Host nutzen, möglich?

Allgemeine Diskussionen über den Einsatz von VirtualBox.
Post Reply
r0mY
Posts: 2
Joined: 12. Nov 2022, 17:50

Drucker aus meinem Gastsystem im Host nutzen, möglich?

Post by r0mY »

Hallöchen,

ich nutze Virtualbox 5.2.44 auf meinem Laptop unter Win7.
Ich habe einen alten Drucker der nur Treiber für XP hat.
Momentan nutze ich den Gemeinsamen Ordner im Gast XP Prof. um Dateien/Bilder vom Gast aus zugänglich zu machen und drucke sie dann vom Gast aus.

Gibt es eine Möglichkeit, den Drucker irgendwie freizugeben, so dass ich vom Host auch drucken kann?
Oder klappt das nicht, weil es die Treiber nicht für Win7 gibt? Bin da etwas überfragt/kenne mich auch nicht so git aus.

Netzwerk ist momentan auf NAT eingestellt.

Liebe Grüße

Romy :o)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Drucker aus meinem Gastsystem im Host nutzen, möglich?

Post by scottgus1 »

This:
r0mY wrote:Oder klappt das nicht, weil es die Treiber nicht für Win7 gibt?
is a problem. Each OS using a shared printer needs its own drivers. Your present setup of passing files to the XP VM for printing is the only way if you cannot get Windows 7 drivers for the printer.
r0mY
Posts: 2
Joined: 12. Nov 2022, 17:50

Re: Drucker aus meinem Gastsystem im Host nutzen, möglich?

Post by r0mY »

I almost thought so.

In the meantime, I looked for other solutions and I remembered an app for iOS that I had installed on noem iPhone and also Windows at the time. From Readdle the Printer Pro app. Unfortunately, this is no longer updated in the AppStore and can not be installed on my new device. Maybe I could have printed at least from my iPhone.

Maybe I can think of something else to simplify a few steps of printing or just create something fun.

Thanks for your quick and helpful reply.


Best regards from Germany

Romy
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Drucker aus meinem Gastsystem im Host nutzen, möglich?

Post by scottgus1 »

I had a Windows-7-compatible printer which didn't have Windows 10 drivers. I made a VBscript that monitored a shared folder for PDFs then printed and deleted the PDFs. I'd print to PDF on the 10 PCs, then copy the PDF to the shared folder.

Code: Select all

'Monitors shared folders for PDFs appearing, then prints and deletes the PDFs.
'If the PDF has the text "(#)copies" in the name, # prints will be made of that PDF.

Set fso = CreateObject("Scripting.FileSystemObject")
Set shell = WScript.CreateObject ("WSCript.shell")
on error resume next

'Adjust these arrays for one or more printers and the shared folder for each printer.
'A single shared folder with different subfolders will also work.
Dim pdflocation(1) 'shared folders to monitor
pdflocation(0)="R:\PDFprint\Brother8670"
pdflocation(1)="R:\PDFprint\BrotherHL1440" 
Dim printername(1) 'printer names in "Devices and Printers" for each shared folder.
printername(0)="Brother MFC-8670DN USB Printer"
printername(1)="Brother HL-1440"

do

For printerindex = 0 To 1

Set fol = fso.GetFolder(pdflocation(printerindex))
Set filecol = fol.Files
For Each fil in filecol
  filename = fil.name
  fileext=ucase(fso.GetExtensionName(fil.name))
  if fileext = "PDF"
    numcopies = 1
    copycount = 0
    testcopies = instr(filename,")copies") 'if file has (#)copies in the name, # prints will be made
    copytally = ""
    if testcopies <> 0 then
      for x = (testcopies - 1) to 1 step -1
      if instr("0123456789",mid(filename,x,1)) = 0 then exit For 'exit upon opening parenthesis (
      copytally = mid(filename,x,1) & copytally
      next
    end if 
    if isnumeric(copytally) then
      numcopies = cint(copytally)
    end if
    'edit runstring for PDF viewer installed
    runstring="""C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe"" /t """&pdflocation(printerindex)&"\"&fil.name&""" """ & printername(printerindex) & """"
    do
      shell.run runstring
      copycount = copycount + 1
    loop until copycount >= numcopies
    do
      err.clear
      wscript.sleep 5000
      fso.deletefile pdflocation(printerindex)&"\"&fil.name
    loop until err.number=0 
  end if
Next 'fil in filecol
wscript.sleep 3000
set filecol=nothing
Set fol = Nothing

Next 'printerindex

loop
Post Reply