SamSam Posted September 22, 2020 Posted September 22, 2020 (edited) Ok I found the error for the Kiocera, I made a mistake in the driver name... I add a space before "KX". Edited September 22, 2020 by SamSam
mLipok Posted September 22, 2020 Posted September 22, 2020 (edited) @jguinch I download your UDF from OP and chceck them ... little refactor to be compilant with: #AutoIt3Wrapper_Run_AU3Check=Y #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 There is one problem in: Func _PrintMgr_AddTCPIPPrinterPort($sPortName, $sPortIP, $sPortNumber) Local $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") If Not IsObj($oWMIService) Then Return SetError(1, 0, 0) Local $oNewPort = $oWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance _ If Not IsObj($oNewPort) Then Return SetError(1, 0, 0) $oNewPort.Name = $sPortName $oNewPort.Protocol = 1 $oNewPort.HostAddress = $sPortIP $oNewPort.PortNumber = $sPortNumber $oNewPort.SNMPEnabled = True Local $ret = $oNewPort.Put_ #forceref $ret Return 1 EndFunc ;==>_PrintMgr_AddTCPIPPrinterPort Quote "C:\Users\Szef\Downloads\PrintMgr.au3"(169,4) : error: syntax error If ^ "C:\Users\Szef\Downloads\PrintMgr.au3"(169,52) : error: Statement cannot be just an expression. If Not IsObj($oNewPort) Then Return SetError(1, 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\Szef\Downloads\PrintMgr.au3"(169,55) : error: Statement cannot be just an expression. If Not IsObj($oNewPort) Then Return SetError(1, 0, 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\Szef\Downloads\PrintMgr.au3"(169,57) : error: Statement cannot be just an expression. If Not IsObj($oNewPort) Then Return SetError(1, 0, 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Could you please check it ? EDIT: Here are my modifed/refactored/reviewed scripts: PrintMgr.au3 PrintMgr_Example.au3 Edited September 22, 2020 by mLipok jguinch 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
jguinch Posted September 23, 2020 Author Posted September 23, 2020 Thanks very much @mLipok. I need to get used to using # AutoIt3Wrapper_Au3Check_Parameters... 😕 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
mLipok Posted September 24, 2020 Posted September 24, 2020 On 9/22/2020 at 11:16 AM, mLipok said: Could you please check it ? Will you be able to look on this ? Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
jguinch Posted September 24, 2020 Author Posted September 24, 2020 Sorry, @mLipok I didn't take enough time to correct all. I just downloaded your corrected version (and also added corrections) + updated/corrected the example code. mLipok 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
mLipok Posted September 25, 2020 Posted September 25, 2020 New version: Quote #CS HISTORY and RELASE NOTES 2013/10/17-2020/09/21 @jguinch and other..... I @mLipok do not know the story @jguinch must to rewrite it 2020/09/22 @mlipok * changed - little refactor to be compilant with Au3Check 2020/09/24 @jguinch * fixed - issue which @mLipok found thanks to Au3Check - .SpawnInstance _ * fixed - in _PrintMgr_RemoveLPRPort() function header/documentation _AddLocalPrinterPort >> _PrintMgr_AddLPRPort 2020/09/25 @mlipok * added - HISTORY and RELASE NOTES * fixed - in _PrintMgr_RemoveLocalPort() function header/documentation _AddLocalPrinterPort >> _PrintMgr_AddLocalPort * changed - proper functions name _Printmgr_* >> _PrintMgr_* * changed - modified example - fixed for Au3Check compilance and fixed function names #CE @jguinch please check when you will have some spare time. PrintMgr.au3 PrintMgr_Example.au3 jguinch 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
jguinch Posted October 4, 2020 Author Posted October 4, 2020 thank you @mLipok I just completed the header and posted the updated file. mLipok 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
maniootek Posted November 17, 2020 Posted November 17, 2020 Thank you for such useful script. Good job guys!
maniootek Posted November 17, 2020 Posted November 17, 2020 (edited) Didn't you plan to create global enum values for table index reference of result of functions like _PrintMgr_EnumPrinterConfiguration or _PrintMgr_EnumPrinterProperties ? Edited November 17, 2020 by maniootek
jguinch Posted November 17, 2020 Author Posted November 17, 2020 (edited) @maniootek : well, I thought about it but didn't really know how. Here is a new version (-see first message- ). Please, give me your advice PrintMgr.au3 Edited November 17, 2020 by jguinch maniootek 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
maniootek Posted November 17, 2020 Posted November 17, 2020 10 minutes ago, jguinch said: @maniootek : well, I thought about it but didn't really know how. Here is a new version. Please, give me your advice : PrintMgr.au3 Yes, this is it. Please also note that if you have some constants with value starting from 0 and increase by 1+ you can use Enum instead of declaring each variable. This piece of code: Global Const $PRINTMGR_PROPERTY_ATTRIBUTES = 0 Global Const $PRINTMGR_PROPERTY_AVAILABILITY = 1 Global Const $PRINTMGR_PROPERTY_AVAILABLEJOBSHEETS = 2 Global Const $PRINTMGR_PROPERTY_AVERAGEPAGESPERMINUTE = 3 Do the same job as this one: Global Enum $PRINTMGR_PROPERTY_ATTRIBUTES, $PRINTMGR_PROPERTY_AVAILABILITY, $PRINTMGR_PROPERTY_AVAILABLEJOBSHEETS, $PRINTMGR_PROPERTY_AVERAGEPAGESPERMINUTE But anyway, the first version even looks better.
jguinch Posted November 17, 2020 Author Posted November 17, 2020 (edited) yes, I know, but I find it more readable like it. 🙂 ... and "some constants with value starting from 0" => it can start with another value (ex Global Const $val = 50, $val2 ... @maniootek : the downloaded link is updated. Thanks for your advice. Edit : I added your name in the HISTORY 😉 Edited November 17, 2020 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Trong Posted November 18, 2020 Posted November 18, 2020 After running the script, the printer is not removed. Don't know why it doesn't remove the printer? And windows has shown that the printer driver is unavailable! Enjoy my work? Buy me a 🍻 or tip via ❤️ PayPal
jguinch Posted November 18, 2020 Author Posted November 18, 2020 @VIP : can you say me what does the function _PrintMgr_RemovePrinter returns (and the value of @error) ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Trong Posted November 19, 2020 Posted November 19, 2020 @jguinch _PrintMgr_RemovePrinter returns 1 and @Error 0 But the printer has been removed in the Printer Management. I added a line of code to the UDF and the printer is completely removed! Enjoy my work? Buy me a 🍻 or tip via ❤️ PayPal
Trong Posted November 19, 2020 Posted November 19, 2020 (edited) I tweaked the function to get more options! Global $_PrintMgr_ObjError=0, $_ObjError = ObjEvent("AutoIt.Error", "_ObjError") ; Initialize a COM error handler ; This is custom defined error handler Func _ObjError() $_PrintMgr_ObjError=1 Return SetError(1, 0, 0) EndFunc ;==>_ObjError Func _PrintMgr_AddTCPIPPrinterPort($sPortName, $sPortIP, $sPortNumber, $sProtocol = 1, $sSNMPEnabled = True, $sLPRQueue = Default, $sByteCount = Default, $sDisableBidi = False,$sPrinterName="" ) ; Protocol 1=RAW, 2=LPR Local $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") If Not IsObj($oWMIService) Then Return SetError(1, 0, 0) Local $oNewPort = $oWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_ If Not IsObj($oNewPort) Then Return SetError(1, 0, 0) $oNewPort.Name = $sPortName $oNewPort.Protocol = $sProtocol $oNewPort.HostAddress = $sPortIP $oNewPort.PortNumber = $sPortNumber If $sByteCount <> Default Then $oNewPort.ByteCount = $sByteCount If $sLPRQueue <> Default Then $oNewPort.Queue = $sLPRQueue If Not $sLPRQueue Then $oNewPort.SNMPEnabled = $sSNMPEnabled Local $ret = $oNewPort.Put_ #forceref $ret If $sDisableBidi And ($sPrinterName<>"") Then Run('"' & @ComSpec & '" /c rundll32 printui.dll,PrintUIEntry /Xs /n "' & $sPrinterName & '" attributes -EnableBidi', @WindowsDir & "\System32", @SW_HIDE) If $_PrintMgr_ObjError=1 Then $_PrintMgr_ObjError=0 Return SetError(1, 0, $ret) EndIf Return 1 EndFunc ;==>_PrintMgr_AddTCPIPPrinterPort Edited November 20, 2020 by VIP iRet Enjoy my work? Buy me a 🍻 or tip via ❤️ PayPal
jguinch Posted November 19, 2020 Author Posted November 19, 2020 Ok @VIP, thanks for your feedback. I'm not sure it's useful to post screenshot everytime 🤔 I'll try to reproduce the issue (not know, i'm too busy these days) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
jguinch Posted January 8, 2021 Author Posted January 8, 2021 @VIP Sorry fot the delay. I just checked the behaviour that you pointed out, and I didn't manage to reproduce the issue. The printer was removed in both the Printer management and the Printers standard GUI I think it's a display issue due to the use of #RequireAdmin in a non-admin user session. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
aaronhunter Posted August 26, 2021 Posted August 26, 2021 (edited) Hi all My Script or Script to EXE works fine on my PC , but not on others. Could any one help review my code and give me some advice ? #include <Array.au3> #include "PrintMgr\PrintMgr.au3" DriveMapAdd("P:", "\\192.168.2.78\Driver\Printer Driver") _PrintMgr_AddPrinterDriver("Canon Generic Plus UFR II", "Windows NT x64", "P:\\GPlus_UFRII_Driver_V220_W64_2011\Driver","P:\\GPlus_UFRII_Driver_V220_W64_2011\Driver\CNLB0MA64.INF") _PrintMgr_AddTCPIPPrinterPort("SDD-CANON-IR-ADV-C5550", "SDD-CANON-IR-ADV-C5550", 9100) _PrintMgr_AddPrinter("iR-ADV C5550", "Canon Generic Plus UFR II", "SDD-CANON-IR-ADV-C5550") _PrintMgr_SetDefaultPrinter("iR-ADV C5550") DriveMapDel("P:") here is the error message I saw someone got the error too, I'm sure it's not about the permission. >"C:\Users\Administrator\Desktop\AutoIT\AutoIT\autoit-v3\install\SciTe\..\AutoIt3.exe" "C:\Users\Administrator\Desktop\AutoIT\AutoIT\autoit-v3\install\SciTe\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Administrator\Desktop\AutoIT\AutoIT\GUI\MetroUDF-v5.1\MetroUDF-v5.1\MetroPrintinstall_Test.au3" /UserParams +>14:56:18 Starting AutoIt3Wrapper (19.1127.1402.0} from:SciTE.exe (3.5.4.0) Keyboard:00000404 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0404) CodePage:950 utf8.auto.check:4 +> SciTEDir => C:\Users\Administrator\Desktop\AutoIT\AutoIT\autoit-v3\install\SciTe UserDir => C:\Users\Administrator\Desktop\AutoIT\AutoIT\autoit-v3\install\SciTe\AutoIt3Wrapper >Running AU3Check (3.3.14.4) from:C:\Users\Administrator\Desktop\AutoIT\AutoIT\autoit-v3\install input:C:\Users\Administrator\Desktop\AutoIT\AutoIT\GUI\MetroUDF-v5.1\MetroUDF-v5.1\MetroPrintinstall_Test.au3 +>14:56:19 AU3Check ended.rc:0 >Running:(3.3.14.4):C:\Users\Administrator\Desktop\AutoIT\AutoIT\autoit-v3\install\autoit3_x64.exe "C:\Users\Administrator\Desktop\AutoIT\AutoIT\GUI\MetroUDF-v5.1\MetroUDF-v5.1\MetroPrintinstall_Test.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop."C:\Users\Administrator\Desktop\AutoIT\AutoIT\GUI\MetroUDF-v5.1\MetroUDF-v5.1\PrintMgr\PrintMgr.au3" (312) : ==> The requested action with this object has failed.: $oPrinter.Put_ $oPrinter^ ERROR ->14:56:19 AutoIt3.exe ended.rc:1 +>14:56:19 AutoIt3Wrapper Finished. >Process failed to respond; forcing abrupt termination...>Exit code: 2 Time: 4.491 Edited August 26, 2021 by aaronhunter more information
mLipok Posted August 26, 2021 Posted August 26, 2021 (edited) This error could be related to Au3Check, so I do some review here: https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printer#methods and I do not see such method property ".Put_" Of coruse my investigation could be wrong. EDIT: running PrintMgr_Example.au3 without Au3Check Quote OK Line 312 (File "Z:\!!!_SVN_AU3\UDF_Forum\_Not_Used_Yet\PrintMgr\PrintMgr.au3"): $oPrinter.Put_ $oPrinter^ ERROR Error: The requested action with this object has failed. So this object doesn't have such a method property. Edited August 26, 2021 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
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