Jump to content

frontier6444

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About frontier6444

Profile Information

  • OS
    XP Pro x86

frontier6444's Achievements

0

Reputation

  1. This is to remove printers already installed. Sometimes we have printers that get hosed up and need to be reinstalled. So technically after.
  2. What I am trying to accomplish is to delete a printer on a remote machine without having to connect to it. Here is what I have so far: strComputer = inputbox("Please enter the computer name or IP address.","Computer Name") Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colInstalledPrinters = objWMIService.ExecQuery _ ("Select * from Win32_Printer where DeviceID = 'Printer1'") For Each objPrinter in colInstalledPrinters objPrinter.Delete_ Next Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colInstalledPorts = objWMIService.ExecQuery _ ("Select * from Win32_TCPIPPrinterPort Where Name = 'Printer1'") For Each objPort in colInstalledPorts Objport.Delete_ Next "Printer1" is of course the name of the printer I am removing and this works perfectly but what I would like to do if possible is have it prompt me in a inputbox the name of the printer and whatever is typed in the box goes to where the printer name needs to be in the script. Any assistance would be greatly appreciated. Thank you!
×
×
  • Create New...