VB Code:
Option Explicit 'Globally add or delete network printer(s) to all profiles on a computer. 'Windows 2000/XP no problems. 'Windows NT 4 or below not supported. 'Windows 95/98 dont have anymore so can test. 'Note 1: If you have problems shelling, then you could run all from the command prompt. 'Note 2: If you have a network printer with a space in the name then surround the name in double quotes. 'Note 3: Add a " /y" to the end of the command in order to make the printer the default printer. 'Note 4: This is [b]CASE SENSITIVE!!![/b] 'You need to stop and start the spooler in order to refresh the printers folder after each add/delete. 'At the command prompt: 'NET STOP Spooler - wait for confirmation 'NET START Spooler - wait for confirmation Private Sub cmdGlobalAdd_Click() Shell "Rundll32 printui.dll,PrintUIEntry /g[b]a[/b] /c\\[i]localcomputername[/i] /n\\[i]servername\printername[/i]", vbNormalFocus End Sub Private Sub cmdGlobalDelete_Click() Shell "Rundll32 printui.dll,PrintUIEntry /g[b]d[/b] /c\\[i]localcomputername[/i] /n\\[i]servername\printername[/i]", vbNormalFocus End Sub





Reply With Quote