Jump to content

Set Log On Informations for a service


Recommended Posts

Hi AutoIt Scriptwriters! 

How can i set login information while running and existed service? 

Is there any UDF or API Function for Log On tab of this Area?

I want to set "This account" and Enter my favorite user

Without doing MouseClick and Macro

Screenshot_2019-06-08-03-24-06.thumb.png.a5fadc14b01d8a40de27c456febdd5d0.png

Edited by Colduction
Link to comment
Share on other sites

Never used it myself, but this Service UDF might solve your issue.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

You can use the SC.exe command.  If the service already exists, then the "SC Config ..." command will allow you to modify the account name and password.  Type "SC Config" in a CMD console or Google the SC command for more information.

Link to comment
Share on other sites

  • Moderators
18 hours ago, Colduction said:

I want make my script speedy

SC is quite speedy, and it is a part of Windows for a reason. Why would you not use it?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators
10 hours ago, Colduction said:

Is there any thing faster than SC? 

C++ - oh, wait, that is what SC.exe is written in...

Straight machine code - good luck with that.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I think the performance using DLL API calls compared to using sc.exe will be negligible. 

If you'd really prefer to do the API calls yourself, the Service UDF has three of the DLL calls you'll need--OpenSCManager, OpenService and CloseServiceHandle--but I don't see a function in the UDF for ChangeServiceConfig, so you'l have to create that one. 

You can look at my example here for another DLL call (ChangeServiceConfig2) to give you an idea on how to "code" it, and this MSDN example is a good resource.

Let us know where you get stuck.

Edited by spudw2k
added more important info
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...