Add a printer using the DllCall command in AHK

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
bshogeman
Posts: 4
Joined: 13 Oct 2022, 07:22
Contact:

Add a printer using the DllCall command in AHK

Post by bshogeman » 24 May 2023, 03:45

Can someone help me with how to form a correct dllcall statement that does the same as the following command: RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b “PrinterName” /r "http://ipadress:631/ipp/print" /m “Microsoft IPP Class Driver”
In powershell it would be: Add-Printer -Name "PrinterName" -DriverName "Microsoft IPP Class Driver" -PortName "http://ipaddress:631/ipp/print"

I know I can normaly use the RunWait command and use it as rundll32.exe of powershell.exe command but the issue is that this is for a protected enviroment where only some executables are allowed to run. So a code using a dllcall would not ask to add an other executable to the allow list.

Return to “Ask for Help (v2)”