![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Removing Printers I am trying to find info on writing a script that can automate the removal of the "Microsoft XPS Document Writer". I couldn't find a powershell command to do it or WMI Class that could help me. Win32_printer seems to have a method to add printers but not remove. Can anyone give me a few pointers? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Removing Printers malckelly wrote: Quote: > I am trying to find info on writing a script that can automate the removal of > the "Microsoft XPS Document Writer". I couldn't find a powershell command to > do it or WMI Class that could help me. Win32_printer seems to have a method > to add printers but not remove. > > Can anyone give me a few pointers? http://www.microsoft.com/technet/scr...5/hey1201.mspx On XP SP2, I looked for the Delete_ method, but can't find it. I also tried via wmic (in case PowerShell had a problem with the "_" somehow in a method name). What operating system(s)? Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Removing Printers Sorry I should have said. Its Vista 32bit "Marco Shaw [MVP]" wrote: Quote: > malckelly wrote: Quote: > > I am trying to find info on writing a script that can automate the removal of > > the "Microsoft XPS Document Writer". I couldn't find a powershell command to > > do it or WMI Class that could help me. Win32_printer seems to have a method > > to add printers but not remove. > > > > Can anyone give me a few pointers? > Strangely: > http://www.microsoft.com/technet/scr...5/hey1201.mspx > > On XP SP2, I looked for the Delete_ method, but can't find it. I also > tried via wmic (in case PowerShell had a problem with the "_" somehow in > a method name). > > What operating system(s)? > > Marco > > -- > Microsoft MVP - Windows PowerShell > http://www.microsoft.com/mvp > > PowerGadgets MVP > http://www.powergadgets.com/mvp > > Blog: > http://marcoshaw.blogspot.com > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Removing Printers "Marco Shaw [MVP]" wrote: Quote: > malckelly wrote: Quote: > > I am trying to find info on writing a script that can automate the removal of > > the "Microsoft XPS Document Writer". I couldn't find a powershell command to > > do it or WMI Class that could help me. Win32_printer seems to have a method > > to add printers but not remove. > > > > Can anyone give me a few pointers? > Strangely: > http://www.microsoft.com/technet/scr...5/hey1201.mspx > > On XP SP2, I looked for the Delete_ method, but can't find it. I also > tried via wmic (in case PowerShell had a problem with the "_" somehow in > a method name). > System.Management.ManagementObject and then use it's Delete() method. [System.Management.ManagementObject]$printer.Delete() -- urkec -- urkec |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Removing Printers I'm a bit late, but I just had to remove some printers myself. The WMI object returned by Get-WMIObject does have a delete scriptmethod. TypeName: System.Management.ManagementObject#root \cimv2\Win32_Printer TypeName: System.Management.ManagementObject#root \cimv2\Win32_Printer Name MemberType Definition ---- ---------- ---------- ConvertFromDateTime ScriptMethod System.Object ConvertFromDateTime(); ConvertToDateTime ScriptMethod System.Object ConvertToDateTime(); Delete ScriptMethod System.Object Delete(); GetType ScriptMethod System.Object GetType(); Put ScriptMethod System.Object Put(); On Dec 4, 9:36 am, urkec <ur...@xxxxxx> wrote: Quote: > "Marco Shaw [MVP]" wrote: Quote: > > malckelly wrote: Quote: > > > I am trying to find info on writing a script that can automate the removal of > > > the "Microsoft XPS Document Writer". I couldn't find a powershell command to > > > do it or WMI Class that could help me. Win32_printer seems to have a method > > > to add printers but not remove. Quote: Quote: > > > Can anyone give me a few pointers? Quote: Quote: > > On XP SP2, I looked for the Delete_ method, but can't find it. I also > > tried via wmic (in case PowerShell had a problem with the "_" somehow in > > a method name). > I think this can be done by casting the Win32_Printer instance to > System.Management.ManagementObject and then use it's Delete() method. > > [System.Management.ManagementObject]$printer.Delete() > > -- > urkec > > -- > urkec |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Removing Network Printers - Two Quick Questions Please | VB Script | |||
| Removing network printers | Vista General | |||
| Re: Removing network printers | Vista print fax & scan | |||
| USB Printer Ports still there after removing printers | Vista print fax & scan | |||
| removing associated Norton files form windows security as it still appears in security centre after removing from registry, application common folders etc | Vista security | |||