Dobson980 Posted September 16, 2016 Posted September 16, 2016 Hello, I'm working on a tool for some basic printer installations. I have a general idea of how I want to accomplish this within Powershell. I am having difficulties invoking these commands via autoit. A powershell script is not applicable here. Below is basically what the end goal is: Invoke-Command {pnputil.exe -a "driverpath/file.inf"} Add-PrinterDriver -Name "SHARP MX-4140N PCL6" Get-PrinterDriver -Name "SHARP MX-4140N PCL6" Add-PrinterPort -Name "PSOCE2S" -PrinterHostAddress "PSOCE2S" Add-Printer -Name "PSOCE2S" -PortName "PSOCE2S" -DriverName "SHARP MX-4140N PCL6" I tried this sort of approach without much luck: Run("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe") WinWaitActive("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe") send('Invoke-Command {pnputil.exe -a "driverpath\file.inf"}' & "{ENTER}") ... without much luck. Is there a better way to go about this?
Moderators JLogan3o13 Posted September 17, 2016 Moderators Posted September 17, 2016 You say a powershell is not applicable, does this mean you want to do it natively in AutoIt? If so, do a forum search for the Printers UDF. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now