AutoHotkey Community

It is currently May 26th, 2012, 11:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Some Utilities
PostPosted: April 10th, 2004, 3:21 am 
Offline

Joined: March 2nd, 2004, 10:10 pm
Posts: 443
Location: SLC, Utah
Here are some dos utilities I use: Download by right-click / Save Target As... (93 KB)

Included in utilities.zip are:

addusers.exe
Can be used to Add, Update, or Delete Windows NT/2000/XP users on local computer or domain.

blat.exe
Can be used to send out emails via SMTP

elogdmp.exe
Windows NT/2000/XP Event Log Query Tool for local and remote PC's. Can export Event Logs to a text file for parsing.

reg.exe
Registry utility that lets you almost do anything to local and remote PC Registries.

rkill.exe & rkillsrv.exe
Remotely Kill processes by name, or PID.

sc.exe
Utility to Add, Update, Delete, Configure, Start, Stop, and Pause Windows Services.

srvany.exe
Utility to run any application as a service. This doesn't have a built in help, but if anyone is interested on how to use this let me know.

thanks,
beardboy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2004, 10:54 am 
If you use Blat (Thx beardboy :D ) here's his perfect partner

GetMail
Easily download mail to your harddrive from the command line!


Report this post
Top
  
Reply with quote  
 Post subject: using SrvAny
PostPosted: April 26th, 2004, 11:57 pm 
Offline

Joined: April 22nd, 2004, 10:12 pm
Posts: 21
Location: Manchester, UK
I've had a few problems running a script as a scheduled task in Windows 2k, (I'm guessing it's because it can't activate and de-activate the tasks) however, will this get around this problem?

Jon


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2004, 12:10 am 
Offline

Joined: March 2nd, 2004, 10:10 pm
Posts: 443
Location: SLC, Utah
Are you going to want to the script running all the time? Or are you going to want it to run at certain times?

thanks,
beardboy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2004, 7:50 am 
Offline

Joined: April 22nd, 2004, 10:12 pm
Posts: 21
Location: Manchester, UK
Probably at a regular time each week.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2004, 10:04 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
AHK definitely isn't designed to be run as a service, or by any scheduler that runs things in the absence of a desktop. I'd be interested to know if anyone gets such a thing working or can explain how application windows can even exist when there is no desktop.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Task Scheduling
PostPosted: April 27th, 2004, 10:19 am 
Offline

Joined: April 22nd, 2004, 10:12 pm
Posts: 21
Location: Manchester, UK
I'd made the assumption (probably wrongly) that you can "force" a service to interact with the desktop?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2004, 11:15 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Now that you mention it, I do seem to remember an option like that. If there are any server admins here, maybe they can confirm.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2004, 2:48 pm 
Offline

Joined: March 2nd, 2004, 10:10 pm
Posts: 443
Location: SLC, Utah
You can setup services to interact with the desktop. I had an AHK application that I had run as a service, and everything was running fine. Except for a Clipper application that I ran from the AHK service sometimes had some problems.

If you want your application to only run at a regular time each week, you could have it always running and just write in your script to kick off and do stuff at the designated time.

Here are two simple lines to add any program as a service. AHKService is the name you choice for your service, make sure to change that on both lines if you change the name. Srvany.exe can be placed anywhere I just put it in the winnt\system32 folder. And your Program which I named as AHKProgram of course can have any name and be in any folder.
Code:
sc create AHKService binPath= c:\winnt\system32\srvany.exe type= own type= interact start= auto

reg add HKLM\system\currentcontrolset\services\AHKService\Parameters\Application=c:\winnt\AHKProgram.exe

After you run both those commands you will have a service that will be startable. You can go into Services and change who the service logs in as, if you want it to start automaticlly, manually, etc...

If you have any questions let me know.

thanks,
beardboy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2004, 6:33 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
an addition to ur list beardboy:

a small (25k) command line utility to view, kill, suspend/resume or set the priority and affinity of processes. (free)

http://www.beyondlogic.org/solutions/processutil/processutil.htm

btw there r some more nice utils for networks on this site.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 12:45 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
i tried srvany. i made sure that both cmds gave success messages. i tried it with with a compiled ahk script... it just had this:

Code:
loop
{
   fileappend, %A_Hour%:%A_Min%:%A_Sec%`n, c:\timer.txt
   sleep, 5000
}


nothing happened.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 1:48 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
That's a little disappointing. Maybe there's something in the code that prevents AutoHotkey from launching if it doesn't have access to the desktop or the Explorer shell. Has anyone ever gotten a script, compiled or otherwise, to launch as a service and do something useful?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 2:03 am 
Offline

Joined: September 2nd, 2004, 1:08 am
Posts: 124
Location: Sunnyvale
Chris wrote:
That's a little disappointing. Maybe there's something in the code that prevents AutoHotkey from launching if it doesn't have access to the desktop or the Explorer shell. Has anyone ever gotten a script, compiled or otherwise, to launch as a service and do something useful?


It works for me! :D

Here is my registry tree:
Code:
REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AHKService]
"Type"=dword:00000110
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):45,3a,5c,50,72,6f,67,72,61,6d,20,46,69,6c,65,73,5c,52,65,73,\
  6f,75,72,63,65,20,4b,69,74,5c,73,72,76,61,6e,79,2e,65,78,65,00
"ObjectName"="LocalSystem"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AHKService\Parameters]
"Application"="c:\\autokey\\test.exe"


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AHKService\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
  00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
  00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AHKService\Enum]
"0"="Root\\LEGACY_AHKSERVICE\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001



Note I used slightly different paths... And I did have to use different reg.exe parameters since it was obvious that beardboy was using a version that is not the same as mine. Here is the reg.exe command that I used:

reg add HKLM\system\currentcontrolset\services\AHKService\Parameters /v Application /d c:\autokey\test.exe

Output:
C:\autokey>cat \timer.txt
17:55:00
17:55:05
17:55:10
17:55:15
17:55:20
17:55:25

_________________
I am he of whom he speaks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 4:19 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
thanx. i'll check it out.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 6:55 am 
Offline

Joined: March 2nd, 2004, 10:10 pm
Posts: 443
Location: SLC, Utah
Sorry I never posted a tutorial on how to get this setup correctly.

First I copy srvany.exe into the system32 folder.
Then using sc.exe I would create a new service. You have to point the name of the exe for the service to srvany.exe
Code:
sc create AHKService binPath= c:\winnt\system32\srvany.exe type= own type= interact start= auto

Then you have to update the registry to point to your AHK Script or EXE:
Code:
RegWrite, REG_SZ, HKLM, system\currentcontrolset\services\AHKService\Parameters, Application, c:\winnt\system32\AHKScript.exe

Once both these are done if you start the service named AHKService it will start the program srvany.exe and it will start AHKScript.exe.

After you get this all setup you can modify the service to run as an administrator user instead of it being interactive and it could run even if the computer isn't logged on, and or do system tasks that don't require desktop interaction. I have a script I wrote to auto connect me to my work's VPN, and it will have me logged in and connected to the office before I even login to windows.

Let me know if anyone else has any questions.

thanks,
beardboy


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group