Autoit & Powershell

2 posts in this topic


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:

send('Invoke-Command {pnputil.exe -a "driverpath\file.inf"}' & "{ENTER}")

... without much luck. Is there a better way to go about this?

Share this post

Link to post
Share on other sites

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.

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post

Link to post
Share on other sites

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