/build/static/layout/Breadcrumb_cap_w.png

VBS to create a printer instance ?

After the vbs to create me a printer instance due to the vendors custom action not installing it as wanted and not liking deffered exe in the system context.

I'm going to add it to Active setup and se if this sorts the problem for me ?

Big cheers in advance if anyone can help me ?

0 Comments   [ + ] Show comments

Answers (2)

Posted by: turbokitty 17 years ago
6th Degree Black Belt
0
I don't really follow you. Are you looking for the VBS code necessary to create a printer connection?
If so, this should be moved to the Scripting forum.
Posted by: rikx2 17 years ago
Purple Belt
0
Option Explicit

Dim WshShell,objFSO,Return,Windows,ProgramFiles
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Windows = WshShell.ExpandEnvironmentStrings("%windir%")
ProgramFiles = WshShell.ExpandEnvironmentStrings("%ProgramFiles%")

Return = WshShell.Run("net stop spooler",0,True)
Return = WshShell.Run("net start spooler",0,True)

' WorkingDir="<directory where your drivers or files should be">
' Windows=Windows + "inf\<your inf.inf>"

Return = WshShell.Run("rundll32 printui.dll,PrintUIEntry /if /b ""<name of your printer>"" /f " + Windows + " /r ""<port>"" /m ""printer driver model name"" /q /l" & """" <your source path """",0,TRUE)

'------------------------

rgrds,
rick
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ