Olish Posted September 5, 2006 Share Posted September 5, 2006 A rootkit in my machine ? Olivier, from France.Free Wake On LAN script Link to comment Share on other sites More sharing options...
dabus Posted September 5, 2006 Share Posted September 5, 2006 Thanks for sharing this. I could't configure my service created by srvany via sc config. sc config "myService" type= own type= interact always failed. Always told me I did something wrong (if I use this on "real" services, everything is fine). But thanks to ptrex, I can use "build-in" code to configure my own services. Yes!!! Link to comment Share on other sites More sharing options...
ptrex Posted September 5, 2006 Author Share Posted September 5, 2006 @dabus You are welcome !! Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
JohnBailey Posted March 12, 2007 Share Posted March 12, 2007 ROCKS! thanks for speading the knowledge! A decision is a powerful thing Link to comment Share on other sites More sharing options...
kase Posted June 18, 2007 Share Posted June 18, 2007 I am trying to create a polling script that will monitor a particular directory for a filetype. If the file is found, it will launch and application and do stuff and exit from the application. The idea is for someone to drop the file in the specified directory and get the processed files almost immediately. The responsibility of processing the file lies with me, but it is an automatable process. In a nutshell the following needs to be done. 1. Monitor Folder for *.txt files 2. If file found, launch application and open txt file, process it, and then save as <fileName>.new, delete <fileName>.txt 3. Exit application I need to run this repeatedly as a service. How can i achieve that ? Link to comment Share on other sites More sharing options...
flyingboz Posted June 19, 2007 Share Posted June 19, 2007 I need to run this repeatedly as a service. How can i achieve that ? put the process in a loop with no end do sleep [some interval] Look for files.... if any match, process file until forever Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
ptrex Posted June 19, 2007 Author Share Posted June 19, 2007 @kase Look in my signature for FILE MONITOR. regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
raoman123 Posted January 5, 2008 Share Posted January 5, 2008 @kaseLook in my signature for FILE MONITOR.regards,ptrexI am curious about having AutoIT use a wrapper to perform Service installation. Isn't there a DLL or WMI usage of standard files that come with windows that would provide this facility? I'm surprised that there is no AutoIT UDF or embedded functionality for this. Link to comment Share on other sites More sharing options...
ptrex Posted January 5, 2008 Author Share Posted January 5, 2008 @raoman123 If you would have googled you would have found what you needed. Const $OWN_PROCESS = 16 Const $NOT_INTERACTIVE = True $strComputer = "." $objWMIService = ObjGet("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $objService = $objWMIService.Get("Win32_BaseService") $errReturn = $objService.Create ("_AUService", "Personnel AU Service", _ "c:\windows\system32\AU3_ServiceTest.exe", $OWN_PROCESS ,2 ,"Automatic" , $NOT_INTERACTIVE ,".\LocalSystem" ,"") regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
raoman123 Posted January 7, 2008 Share Posted January 7, 2008 @raoman123 If you would have googled you would have found what you needed. Const $OWN_PROCESS = 16 Const $NOT_INTERACTIVE = True $strComputer = "." $objWMIService = ObjGet("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $objService = $objWMIService.Get("Win32_BaseService") $errReturn = $objService.Create ("_AUService", "Personnel AU Service", _ "c:\windows\system32\AU3_ServiceTest.exe", $OWN_PROCESS ,2 ,"Automatic" , $NOT_INTERACTIVE ,".\LocalSystem" ,"") regards, ptrex Thank you very much. I tried googling and searching this forum and couldn't find what you have placed here. Thanks a bunch. Link to comment Share on other sites More sharing options...
ShminkyBoy Posted July 6, 2008 Share Posted July 6, 2008 (edited) Not sure if this has been asked, but is it still necessary to use a program like srvany.exe etc etc in conjunction with my script to be able to run it as a service? I know that in past versions of autoit srvany.exe was required, but has the new version changed this restriction? Just curious to know whether I'd be wasting my time trying figure out how to do that natively with the new autoit, thanks! Edited July 6, 2008 by ShminkyBoy Urban Terror - ioUrban Terror website Like-yea Link to comment Share on other sites More sharing options...
au3scr Posted July 6, 2008 Share Posted July 6, 2008 I cant get it work >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\rain\Desktop\New AutoIt v3 Script.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>23:45:30 Starting AutoIt3Wrapper v.1.10.1.8 Environment(Language:0409 Keyboard:00000425 OS:WIN_XP/Service Pack 2 CPU:X86) >Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3 C:\Documents and Settings\rain\Desktop\New AutoIt v3 Script.au3(24,66) : WARNING: $WS_OVERLAPPEDWINDOW: possibly used before declaration. GUICreate("Au3@Service", 570, 668, 289, 123, $WS_OVERLAPPEDWINDOW) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rain\Desktop\New AutoIt v3 Script.au3(24,66) : ERROR: $WS_OVERLAPPEDWINDOW: undeclared global variable. GUICreate("Au3@Service", 570, 668, 289, 123, $WS_OVERLAPPEDWINDOW) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rain\Desktop\New AutoIt v3 Script.au3(26,50) : ERROR: _GUICtrlListViewSetColumnWidth(): undefined function. _GUICtrlListViewSetColumnWidth ($listview1, 0,320) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rain\Desktop\New AutoIt v3 Script.au3(52,63) : ERROR: _GUICtrlListViewGetSubItemsCount(): undefined function. Dim $B_DESCENDING[_GUICtrlListViewGetSubItemsCount ($listview1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rain\Desktop\New AutoIt v3 Script.au3(115,47) : ERROR: _GUICtrlListViewDeleteAllItems(): undefined function. _GUICtrlListViewDeleteAllItems ($listview1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rain\Desktop\New AutoIt v3 Script.au3 - 4 error(s), 1 warning(s) !>23:45:31 AU3Check ended.rc:2 >Exit code: 0 Time: 6.521 Link to comment Share on other sites More sharing options...
SxyfrG Posted July 6, 2008 Share Posted July 6, 2008 one of the recent updates made changes to the way UDF functions are labelled and how the includes are organised. Just add this at the top of the script: #include <WindowsConstants.au3> and then just add an underscore ( _ ) after _GUICtrlListView. Hope this helps My scripts:AppLauncherTRAY - Awesome app launcher that runs from the system tray NEW VERSION! | Run Length Encoding - VERY simple compression in pure autoit | Simple Minesweeper Game - Fun little game :)My website Link to comment Share on other sites More sharing options...
Michel Claveau Posted July 7, 2008 Share Posted July 7, 2008 Hi!is it still necessary to use a program like srvany.exe ... to be able to run it as a service?alternative: you can use SC.EXE (in command-line), for launch your script as a service. Link to comment Share on other sites More sharing options...
ShminkyBoy Posted July 16, 2008 Share Posted July 16, 2008 Hi!alternative: you can use SC.EXE (in command-line), for launch your script as a service.Understood- just wondering if autoit gained the ability to do this natively yet or not.I'm currently using srvany.exe, no need to switch away from it to sc.exe if I've already got it working..I just wanted to know if anyone has tried to see if it can be done natively with the newer version of autoit yet =) (didn't the inability to do this come from the way autoit previously handled stdin/stdout/stderr or something like that?) Urban Terror - ioUrban Terror website Like-yea Link to comment Share on other sites More sharing options...
ptrex Posted July 17, 2008 Author Share Posted July 17, 2008 @ShminkyBoy I can be done natively. Someone created these funtions to do so. expandcollapse popup;=============================================================================== ; Description: Creates a service on a computer ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used ; $sServiceName - name of the service to create ; $sDisplayName - display name of the service ; $sBinaryPath - fully qualified path to the service binary file ; The path can also include arguments for an auto-start service ; $sServiceUser - [optional] default is LocalSystem ; name of the account under which the service should run ; $sPassword - [optional] default is empty ; password to the account name specified by $sServiceUser ; Specify an empty string if the account has no password or if the service ; runs in the LocalService, NetworkService, or LocalSystem account ; $nServiceType - [optional] default is $SERVICE_WIN32_OWN_PROCESS ; $nStartType - [optional] default is $SERVICE_AUTO_START ; $nErrorType - [optional] default is $SERVICE_ERROR_NORMAL ; $nDesiredAccess - [optional] default is $SERVICE_ALL_ACCESS ; $sLoadOrderGroup - [optional] default is empty ; names the load ordering group of which this service is a member ; Requirements: Administrative rights on the computer ; Return Values: On Success - 1 ; On Failure - 0 and @error is set to extended Windows error code ; Note: Dependencies cannot be specified using this function ; Refer to the CreateService page on MSDN for more information ;=============================================================================== Func _CreateService($sComputerName, _ $sServiceName, _ $sDisplayName, _ $sBinaryPath, _ $sServiceUser = "LocalSystem", _ $sPassword = "", _ $nServiceType = 0x00000010, _ $nStartType = 0x00000002, _ $nErrorType = 0x00000001, _ $nDesiredAccess = 0x000f01ff, _ $sLoadOrderGroup = "") Local $hAdvapi32 Local $hKernel32 Local $arRet Local $hSC Local $lError = -1 $hAdvapi32 = DllOpen("advapi32.dll") If $hAdvapi32 = -1 Then Return 0 $hKernel32 = DllOpen("kernel32.dll") If $hKernel32 = -1 Then Return 0 $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _ "str", $sComputerName, _ "str", "ServicesActive", _ "long", $SC_MANAGER_ALL_ACCESS) If $arRet[0] = 0 Then $arRet = DllCall($hKernel32, "long", "GetLastError") $lError = $arRet[0] Else $hSC = $arRet[0] $arRet = DllCall($hAdvapi32, "long", "OpenService", _ "long", $hSC, _ "str", $sServiceName, _ "long", $SERVICE_INTERROGATE) If $arRet[0] = 0 Then $arRet = DllCall($hAdvapi32, "long", "CreateService", _ "long", $hSC, _ "str", $sServiceName, _ "str", $sDisplayName, _ "long", $nDesiredAccess, _ "long", $nServiceType, _ "long", $nStartType, _ "long", $nErrorType, _ "str", $sBinaryPath, _ "str", $sLoadOrderGroup, _ "ptr", 0, _ "str", "", _ "str", $sServiceUser, _ "str", $sPassword) If $arRet[0] = 0 Then $arRet = DllCall($hKernel32, "long", "GetLastError") $lError = $arRet[0] Else DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0]) EndIf Else DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0]) EndIf DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC) EndIf DllClose($hAdvapi32) DllClose($hKernel32) If $lError <> -1 Then SetError($lError) Return 0 EndIf Return 1 EndFunc ;=============================================================================== ; Description: Deletes a service on a computer ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used ; $sServiceName - name of the service to delete ; Requirements: Administrative rights on the computer ; Return Values: On Success - 1 ; On Failure - 0 and @error is set to extended Windows error code ;=============================================================================== Func _DeleteService($sComputerName, $sServiceName) Local $hAdvapi32 Local $hKernel32 Local $arRet Local $hSC Local $hService Local $lError = -1 $hAdvapi32 = DllOpen("advapi32.dll") If $hAdvapi32 = -1 Then Return 0 $hKernel32 = DllOpen("kernel32.dll") If $hKernel32 = -1 Then Return 0 $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _ "str", $sComputerName, _ "str", "ServicesActive", _ "long", $SC_MANAGER_ALL_ACCESS) If $arRet[0] = 0 Then $arRet = DllCall($hKernel32, "long", "GetLastError") $lError = $arRet[0] Else $hSC = $arRet[0] $arRet = DllCall($hAdvapi32, "long", "OpenService", _ "long", $hSC, _ "str", $sServiceName, _ "long", $SERVICE_ALL_ACCESS) If $arRet[0] = 0 Then $arRet = DllCall($hKernel32, "long", "GetLastError") $lError = $arRet[0] Else $hService = $arRet[0] $arRet = DllCall($hAdvapi32, "int", "DeleteService", _ "long", $hService) If $arRet[0] = 0 Then $arRet = DllCall($hKernel32, "long", "GetLastError") $lError = $arRet[0] EndIf DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hService) EndIf DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC) EndIf DllClose($hAdvapi32) DllClose($hKernel32) If $lError <> -1 Then SetError($lError) Return 0 EndIf Return 1 EndFunc regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ShminkyBoy Posted July 17, 2008 Share Posted July 17, 2008 @ShminkyBoyI can be done natively. Someone created these funtions to do so.regardsptrexThanks for the heads up ptrex, I'll try this tonight, doing services without having to use srvany.exe will make for a nice portable code (I want to be able to drop the script on a workstation pc and have it self-configure as a service on first run without having to worry about support apps) Urban Terror - ioUrban Terror website Like-yea Link to comment Share on other sites More sharing options...
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