Toon posts:

Printer install/uninstall via commando prompt

Pagina: 1
Acties:
  • 309 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Ik heb een programma gemaakt die er achter komt welke NDPS printers er op een Windows XP client staan geinstalleerd.

Nu wil ik deze printers deinstalleren. Ik ben al bezig om het via Win32 API te doen, maar daar ben ik nog even mee bezig.

Mijn vraag is, is het mogelijk om via de commando prompt printers te verwijderen?

Verwijderd

met het "Net use" of "net print" command.

ff wat gegoogled en voila..

net print

Displays information about print queues and controls print jobs.
NET PRINT \\computer[\printer] | port [/YES]
NET PRINT \\computer | port [job# [/PAUSE | /RESUME | /DELETE]] [/YES]


computer Specifies the name of the computer whose print queue you want information about.
printer Specifies the name of the printer you want information about.
port Specifies the name of the parallel (LPT) port on your computer that is connected to the printer you want information about.
job# Specifies the number assigned to a queued print job. You can specify the following options:
/PAUSE Pauses a print job.
/RESUME Restarts a print job that has been paused.
/DELETE Cancels a print job.
/YES Carries out the NET PRINT command without first prompting you to provide information or confirm actions.

When you specify the name of a computer by using the NET PRINT command, you receive information about the print queues on each of the shared printers that are connected to the computer.


net USE

Connects or disconnects your computer from a shared resource or displays information about your connections.
NET USE [drive: | *] [\\computer\directory [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]
NET USE [port:] [\\computer\printer [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]

NET USE drive: | \\computer\directory /DELETE [/YES]
NET USE port: | \\computer\printer /DELETE [/YES]
NET USE * /DELETE [/YES]

NET USE drive: | * /HOME


drive Specifies the drive letter you assign to a shared directory.
* Specifies the next available drive letter. If used with /DELETE, specifies to disconnect all of your connections.
port Specifies the parallel (LPT) port name you assign to a shared printer.
computer Specifies the name of the computer sharing the resource.
directory Specifies the name of the shared directory.
printer Specifies the name of the shared printer.
password Specifies the password for the shared resource, if any.
? Specifies that you want to be prompted for the password of the shared resource. You don't need to use this option unless the password is optional.
/SAVEPW:NO Specifies that the password you type should not be saved in your password-list file. You need to retype the password the next time you connect to this resource.
/YES Carries out the NET USE command without first prompting you to provide information or confirm actions.
/DELETE Breaks the specified connection to a shared
resource.
/NO Carries out the NET USE command, responding with NO automatically when you are prompted to confirm actions.
/HOME Makes a connection to your HOME directory if one is specified in your LAN Manager or Windows NT user account.

To list all of your connections, type NET USE without options

Verwijderd

Topicstarter
Ik wil niet connectie verbreken, ik wil ze verwijderen van de PC...

Verwijderd

Topicstarter
rundll32 printui.dll,PrintUIEntry /?

Hiermee kun je alles doen wat je wilt kwa printers via de commando prompt zonder of met user interference.

Verwijderd

Topicstarter
en toch lukt het hier niet mee.. lijkt net of je ze er alleen maar mee kan toevoegen of connectie er mee kan verbreken? enige ander idee hoe ik via commando prompt printer kan verwijderen?

  • elevator
  • Registratie: December 2001
  • Niet online

elevator

Officieel moto fan :)

[google=con2prt]

Daarmee kan je netwerk connecties verwijderen. Volgens mij is er ook een DeletePrinterConnection() API ?
Pagina: 1