Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/16/2021 in all areas

  1. jguinch

    Printers Management UDF

    Hello. I did create these few functions several months ago. I post here, if it can interest someone. These functions based on WMI queries allow you to manage printers : add / delete printer, driver, port, or obtain configuration, set default printer ... I let you discover it with the code. Here is the list of the available functions : _PrintMgr_AddLocalPort _PrintMgr_AddLPRPort _PrintMgr_AddPrinter _PrintMgr_AddPrinterDriver _PrintMgr_AddTCPIPPrinterPort _PrintMgr_AddWindowsPrinterConnection _PrintMgr_CancelAllJobs _PrintMgr_CancelPrintJob _PrintMgr_EnumPorts _PrintMgr_EnumPrinter _PrintMgr_EnumPrinterConfiguration _PrintMgr_EnumPrinterDriver _PrintMgr_EnumPrinterProperties _PrintMgr_EnumPrintJobs _PrintMgr_EnumTCPIPPrinterPort _PrintMgr_Pause _PrintMgr_PortExists _PrintMgr_PrinterExists _PrintMgr_PrinterSetComment _PrintMgr_PrinterSetDriver _PrintMgr_PrinterSetPort _PrintMgr_PrinterShare _PrintMgr_PrintTestPage _PrintMgr_RemoveLocalPort _PrintMgr_RemoveLPRPort _PrintMgr_RemovePrinter _PrintMgr_RemovePrinterDriver _PrintMgr_RemoveTCPIPPrinterPort _PrintMgr_RenamePrinter _PrintMgr_Resume _PrintMgr_SetDefaultPrinter And some examples : #include <Array.au3> #include "PrintMgr.au3" _Example() Func _Example() ; Remove a printer called "My old Lexmark printer" : _PrintMgr_RemovePrinter("My old Lexmark printer") ; Remove the driver called "Lexmark T640" : _PrintMgr_RemovePrinterDriver("Lexmark T640") ; Remove the TCP/IP printer port called "TCP/IP" _PrintMgr_RemoveTCPIPPrinterPort("MyOLDPrinterPort") ; Add a driver, called "Samsung ML-451x 501x Series", and driver inf file is ".\Samsung5010\sse2m.inf" _PrintMgr_AddPrinterDriver("Samsung ML-451x 501x Series", "Windows NT x86", @ScriptDir & "\Samsung5010", @ScriptDir & "\Samsung5010\sse2m.inf") ; Add a TCP/IP printer port, called "MyTCPIPPrinterPort", with IPAddress = 192.168.1.10 and Port = 9100 _PrintMgr_AddTCPIPPrinterPort("MyTCPIPPrinterPort", "192.168.1.10", 9100) ; Add a printer, give it the name "My Printer", use the driver called "Samsung ML-451x 501x Series" and the port called "MyTCPIPPrinterPort" _PrintMgr_AddPrinter("My Printer", "Samsung ML-451x 501x Series", "MyTCPIPPrinterPort") ; Set the printer called "My Printer" as default printer _PrintMgr_SetDefaultPrinter("My Printer") ; Connect to the shared printer "\\192.168.1.1\HPDeskjetColor") _PrintMgr_AddWindowsPrinterConnection("\\192.168.1.1\HPDeskjetColor") ; List all installed printers Local $aPrinterList = _PrintMgr_EnumPrinter() _ArrayDisplay($aPrinterList) ; List all printers configuration Local $aPrinterConfig = _PrintMgr_EnumPrinterConfiguration() _ArrayDisplay($aPrinterConfig) ; List all installed printer drivers Local $aDriverList = _PrintMgr_EnumPrinterDriver() _ArrayDisplay($aDriverList) ; Retrieve the printer configuration for the printer called "Lexmark T640" $aPrinterConfig = _PrintMgr_EnumPrinterConfiguration("Lexmark T640") _ArrayDisplay($aPrinterConfig) ; Add a local printer port (for a file output) _PrintMgr_AddLocalPort("c:\temp\output.pcl") ; Remove the local port _PrintMgr_RemoveLocalPort("c:\temp\output.pcl") ; Enum a print job Local $aJobList = _PrintMgr_EnumPrintJobs() _ArrayDisplay($aJobList) EndFunc ;==>_Example Download link : PrintMgr_Example.au3 PrintMgr.au3
    1 point
  2. First of all, to prevent misunderstandings and unnecessary disputes : There is nothing wrong with distributing a generated stripped au3 with Autoit3.exe . Let's just hope, that the AutoIt Interpreter itself does not appear on the 'false positive' list in future AV updates . According to my experience, this happens very rarely up to now. If they do, then from the lesser-known AV scanners named by Virustotal. To a certain extent, I agree with you. In reality, however, very few users will bother to analyze a lengthy .au3 script (with various #includes) to see if it might contain malicious code.
    1 point
  3. Hello, I share this open source software with you, which I was inspired a few months ago to do. It is Mini Calendar, where it allows you to multitask about the time. That is, program your schedules or routines, create alarms for a specific time, calendar and personal diary (not yet available) and possibly a clock. I recommend downloading the project from my github (more below) since it contains many changes and corrections with the Graphical User Interface (GUI), changes that are not yet in the compiled version because these compilations are already a release of a new final version. I am currently on version 0.5. In the same way, thanks to those who are going to collaborate or who have already collaborated in the software. There are very few who collaborate, but I hope there is more. Special thanks to @Danifirex for the corrections in most of the graphical interface. Source code (gitHub): https://github.com/rmcpantoja/Mini-Calendar User Manual (English): https://raw.githubusercontent.com/rmcpantoja/Mini-Calendar/main/documentation/En/Manual.txt public version: http://mateocedillo.260mb.net/MC.zip
    1 point
  4. Run the stripper and then distribute the generated stripped au3 with Autoit3.exe, a3x files are also picked up as false positives. Although avoiding AV detection in this method can be used for good as well as evil
    1 point
  5. @Danp2 I agree. I get so hyper focused on one thing. Sorry. The first method did work.
    1 point
  6. @SkysLastChanceOIC. Might have been good to share that info in your OP. 😉 Did you try the first method shown by @mLipok?
    1 point
  7. It works, like @TheDcoder already wrote : @Burgaud : If you 'compile' your application as .a3x , then it will still work (since all required #Include 's are integrated), even if someone completely removes the AutoIt installation. You only have to provide the corresponding (standalone) Version of the Interpreter (AutoIt3.exe/AutoIt3_64.exe) to execute the .a3x-File.
    1 point
  8. You bundle the EXE with your application, no need for installation, it's portable and has no other dependencies. That's one of the cool features of AutoIt
    1 point
  9. Changed a bit Func Disk_GetIndexList() ; Get Clean Disk List Index Array Local $i_Pid = Run('cmd /c wmic diskdrive get index', @WorkingDir, @SW_HIDE, $STDERR_MERGED) ProcessWaitClose($i_Pid) Local $as_Indexes = StringSplit(StringStripWS(StringReplace(StdoutRead($i_Pid), 'Index', '', 0, $STR_NOCASESENSE), BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)), @LF) If IsArray($as_Indexes) Then If $as_Indexes[0] = 3 And StringInStr($as_Indexes[2], 'ERROR', $STR_NOCASESENSE) Then Return SetError(1, @extended, $as_Indexes[3]) ; assume there's been an error Return $as_Indexes Else ; an error occured reading the stdout Return SetError(2, @extended, 'Unable to read wmic output stream') EndIf EndFunc ;==>Disk_GetIndexList
    1 point
  10. Try this #include <array.au3> #include <Constants.au3> #include <MsgBoxConstants.au3> #include <string.au3> Local $as_Indexes = Disk_GetIndexList() If IsArray($as_Indexes) Then _ArrayDisplay($as_Indexes) Else MsgBox($MB_ICONERROR, 'Error', $as_Indexes) EndIf Func Disk_GetIndexList() ; Get Clean Disk List Index Array Local $i_Pid = Run('cmd /c wmic diskdrive get index', @WorkingDir, @SW_HIDE, $STDERR_MERGED) ProcessWaitClose($i_Pid) Local $as_Indexes = StringSplit(StringStripWS(StdoutRead($i_Pid), $STR_STRIPTRAILING), @LF) If IsArray($as_Indexes) Then If StringInStr($as_Indexes[1], 'Index', $STR_NOCASESENSE) Then Return $as_Indexes Else ; assumes errors occured Return SetError(1, @extended, $as_Indexes[3]) EndIf Else ; an error occured reading the stdout Return SetError(2, @extended, 'Unable to read wmic output stream') EndIf EndFunc ;==>Disk_GetIndexList
    1 point
  11. Latest update just released. See below for change log.
    1 point
  12. Try this $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[contains(text(),'Walk" & Chr(160) & "In')]") btw. why you are not using ID ? $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[@id='x2m8_R-s']")
    1 point
  13. Ah, okay, had not delved into the new calculator. Makes sense.
    1 point
  14. Subz

    Test calculator app in Win10

    @Jfish Windows 10 Calculator is a modern app, unlike the previous Windows 7 Calculator app. You'll find that you can't automate it using Autoit control functions. IUIAutomation does work, for modern apps, although last time I tried it was a few years back.
    1 point
  15. I have a calculator automation example in the book in my sig, chapter 15 that automates aspects of calculator by referencing it's controls. It uses the AU3 info tool in Scite which I think should still work for Win10.
    1 point
  16. ..for some reason, the user "Fabrizio" is not in my PC Thanks for sharing Fabrizio
    1 point
  17. Here is an example : The script (self created , > 2500 lines - without the Includes) installs PostgreSQL directly from the binaries. It writes registry entries, sets user rights and much more . Result : I don't want to exclude the possibility that .a3x files will get into the focus of AV-Vendors in the future. However, this cannot be ruled out for .au3 files either .
    0 points
×
×
  • Create New...