Jump to content

Recommended Posts

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...