#61
Posted 19 September 2008 - 03:30 PM
I've not added registry functions.
So the service is not well registered when you create it.
I've discovered it when i was trying to use the sc command : service doesn't exist.
#62
Posted 22 September 2008 - 03:06 PM
or if already created, edit the properties of your service and make it interactive.
#63
Posted 22 September 2008 - 03:41 PM
for me the interaction is possible so i wonder what do you want to do exactly
#64
Posted 22 September 2008 - 04:18 PM
#65
Posted 24 September 2008 - 12:36 AM
I need to be able to monitor a Logon Window, and when the user has logged on, detect subsequent windows, and interact with them from the script, by clicking on buttons, sending keystrokes, launching new programs, etc.
But I can not get this work at all.
When I run a script as service, it can not see all of the desktop windows.
If I uncheck the "Allow Service to Interact with Desktop" the script can see more windows than if it is checked.
I have tried: the service.au3 code, srvany, and even Cygwin's cygrunsrv service wrapper.
Clearly, I am missing something.
Should I be able to interact with any open window from inside a script that is running as a service?
Can anyone explain why I can not use Winlist from a script running as a service?
Can someone provide an example as to how to run an autoit script as a service, detect when someone has logged on, and then launch a program, and then interact with it from inside the script.
Thanks for any help.
#66
Posted 24 September 2008 - 02:14 AM
#67
Posted 24 September 2008 - 08:28 AM
- services are protected before logon to not let malicious software interact before the user login ( imagine a window that could replace the logon window ).
- SYSTEM is an account without user personification. So it can not acces to tihs layer.
- Services are made for agent or something, like antivirus. Their purpose are not to interact with windows or something.
#68
Posted 25 September 2008 - 02:45 AM
C:\FREECOM\AutoIt3\GTs Programs\service.au3(178,7) : ERROR: main(): undefined function. main() ~~~~~^
I'm confused. My program doesn't have a Function called "main" - the main code is enclosed in a While/Wend loop. What do I do?
Thanks,
Graham
Edited by GrahamT, 25 September 2008 - 02:46 AM.
#69
Posted 25 September 2008 - 03:17 AM
Wrap the While/Wend loop inside a Function called main().This is just the code I need to run a program on the computers in my school, so the kids can't it stop from running! However, I can't get it to work. When I try to compile I get this error message
C:\FREECOM\AutoIt3\GTs Programs\service.au3(178,7) : ERROR: main(): undefined function. main() ~~~~~^
I'm confused. My program doesn't have a Function called "main" - the main code is enclosed in a While/Wend loop. What do I do?
Thanks,
Graham
edit:
Edited by spudw2k, 25 September 2008 - 03:18 AM.
Things I've Made: AUHistory ◊ Deck of Cards ◊ HideIt ◊ ICU◊ IconFreezer◊ IpodEjector ◊ LinkDownloader ◊ MD5 Folder Enumerator ◊ PingTool ◊ QuickNIC ◊ ReadOCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam
Misc Code Snippets: ADODB Example ◊ Detect SafeMode ◊ Local Admins ◊ MakeChoice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ System UpTime ◊ Tickle Expired Password ◊ Transpose Array
Projects: Scan Engine Builder ◊ SpeeDBurner
Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ _Service_UDF
#70
Posted 25 September 2008 - 03:30 AM
Great! That worked fine - and its now compiling properly.Wrap the While/Wend loop inside a Function called main().
edit:
But, when I run it in Command Prompt window with -i on the end of the file name, I get Error 1063
The program runs - but its not showing in the services list.
Thanks,
Graham
#71
Posted 27 September 2008 - 05:48 AM
Anybody got any ideas on how to get this to work?Great! That worked fine - and its now compiling properly.
But, when I run it in Command Prompt window with -i on the end of the file name, I get Error 1063
The program runs - but its not showing in the services list.
Thanks,
Graham
Thanks
#72
Posted 29 September 2008 - 04:48 PM
It may attempting to run after you install it (depending on your code). It will fail if it is run this way. Do you see the service in the service control manager? Start -> Run -> services.msc It needs to be started by the SCM.Anybody got any ideas on how to get this to work?
Thanks
Things I've Made: AUHistory ◊ Deck of Cards ◊ HideIt ◊ ICU◊ IconFreezer◊ IpodEjector ◊ LinkDownloader ◊ MD5 Folder Enumerator ◊ PingTool ◊ QuickNIC ◊ ReadOCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam
Misc Code Snippets: ADODB Example ◊ Detect SafeMode ◊ Local Admins ◊ MakeChoice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ System UpTime ◊ Tickle Expired Password ◊ Transpose Array
Projects: Scan Engine Builder ◊ SpeeDBurner
Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ _Service_UDF
#73
Posted 29 September 2008 - 11:50 PM
Thanks for that - yes I think it was attempting to run. Anyway, I already found a freeware program which will install it as a service:It may attempting to run after you install it (depending on your code). It will fail if it is run this way. Do you see the service in the service control manager? Start -> Run -> services.msc It needs to be started by the SCM.
RunAsSvc
Graham
#74
Posted 08 October 2008 - 07:56 AM
thanks a lot for this work.
I've been looking around for a long time for an UDF like this one. Many thanks.
Best wishes
Paul
#75
Posted 24 October 2008 - 01:09 AM
I'm running it on a windows 2003 server with the service properties adjusted to "allow service to interact with desktop".
If i use the example code it works exactly as it should, it displays a msgbox every 1 second.
But as soon as i modify the main function to the following it will not work. It runs the function, everything looks like it should be working, but it flat out does not work. The run function worked, but winwait and send also did not work.
Edited by kjcdude, 24 October 2008 - 01:13 AM.
#76
Posted 24 October 2008 - 09:15 AM
The purpose for me was to make a Nagios agent that could be stop / restarted and controlled by the services easily.
Whenever i see a script containing window manipulation function, i can say that the script will not runs well.
Sry it's a limitation, but a good limitation, for security reasons.
#77
Posted 24 October 2008 - 03:29 PM
remember that the purpose of a service is a background process. It can't interact with desktop like others process because it runs under SYSTEM account with somes limitations.
The purpose for me was to make a Nagios agent that could be stop / restarted and controlled by the services easily.
Whenever i see a script containing window manipulation function, i can say that the script will not runs well.
Sry it's a limitation, but a good limitation, for security reasons.
so why does srvany.exe, runasssvc.exe et al allow the scripts to run with gui and everything using Bitor($service_win32_ownproccess,$service_interactive_process) [spelling probably not right, I'm going off memory here at work... my code is at home=)], but the 'native' autoit routines do not?
also I've tried to read through and figure out my own troubles (posted in other thread), and found of MSDN that there's indeed a 'main()', and that's for console apps.
.. but there's also a 'winmain()' that should be used for GUI processes?
.. also if services were flat out not allowed to interact with users, what would even be the point of having a choice to interact with desktop at all?
.. also in reading about services (I really am trying to contribute, but I'm in way over my head methinks).. there is indeed the SCM which handles the service proccess if it is a console app...
... but for GUI (ie- interactive) the service should use SCP? it this right?
here's the thread and code I'm talking about:
http://www.autoitscript.com/forum/index.php?showtopic=83099
<--- confused now. Please forgive =)
#78
Posted 25 October 2008 - 11:30 AM
The SCM can handle a console process so it's useful to debug a process while it's runing as process. I've not integrated for now.
I agree that it's not really easy. It took me 2 weeks ti understand the whole process and make this UDF? It was not really easy since nothing have been made before.
I don't like srvany since it just acts as a "intermediate" so i can't say what's he's doing. For me it just stats a process, and stop its two ( brutally ).
Will take a look, thx for your investigation it's always good to be curious, and really helpful for proof oc concept
#79
Posted 05 November 2008 - 01:30 PM
Thanx for your hard work arcker, i've been waiting for this type of AutoIt feature for a while now..
Just a few questions though..
Is it possible to have the compiled script .exe, once ran from a double click, install itself as a Service without having to use CMD with the -I parameter..?? Then once Successfully installed start itself up.
And also how could we code in the configuration for the service's settings like: General, Log On, Recovery, Dependencies and all the sub-options for them Ect..??
#80
Posted 05 November 2008 - 04:22 PM
http://www.autoitscript.com/forum/index.ph...st&p=579806Is it possible to have the compiled script .exe, once ran from a double click, install itself as a Service without having to use CMD with the -I parameter..?? Then once Successfully installed start itself up.
Also, check these out. If the service doesn't exist when it's run is asks if you want to install it.
http://www.autoitscript.com/forum/index.ph...st&p=578259
Edited by spudw2k, 05 November 2008 - 04:25 PM.
Things I've Made: AUHistory ◊ Deck of Cards ◊ HideIt ◊ ICU◊ IconFreezer◊ IpodEjector ◊ LinkDownloader ◊ MD5 Folder Enumerator ◊ PingTool ◊ QuickNIC ◊ ReadOCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam
Misc Code Snippets: ADODB Example ◊ Detect SafeMode ◊ Local Admins ◊ MakeChoice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ System UpTime ◊ Tickle Expired Password ◊ Transpose Array
Projects: Scan Engine Builder ◊ SpeeDBurner
Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ _Service_UDF
Also tagged with one or more of these keywords: Service, 1053
AutoIt v3 →
General Help and Support →
compiling EXE to run as a serviceStarted by UglyBob , 12 Oct 2011 |
|
|
||
AutoIt v3 →
Example Scripts →
ProDLLer: Unknown code running? Befriend or Kill!Started by Manko , 24 Nov 2008 |
|
|
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users




