Start a new topic

PowerJobs: Automatic login

Add an option to automatically login when starting powerJobs/restarting the system like the Vault jobprocessor, so it isn't needed anymore to manually login into powerJobs.


20 people like this idea

Hope this option will be available in the next version

Can we please have this feature in the coolOrange powerJobs software as soon as possible, so we do not have to configure so many custom solutions to this simple issue?

Based on the testing that Thomas has done, this would appear to be a good, general-purpose solution, using AutoHotKey - https://www.autohotkey.com/


  • Download the latest installer & install AutoHotkey
  • Download the attached script
  • Right-click -> Compile Script
  • This will build StartPowerJobsAsAdmin.exe
  • You can then move it into your startup folder, or use another method to automatically run it


Note that you need to run powerJobs manually and login successfully with the correct user/password before this will work, 


Also, check Brendan's post earlier if you want to change any of the login settings - his example changes the server


Nick

ahk
(449 Bytes)

1 person likes this

Nick,

Thank you very much for this solution. AutoHotKey now works as desired.
Thanks for your support.

Thomas

 Thomas

 

If you want to force a AutoHotKey script to run as Administrator, you should add this code to the top of the script, and recompile


Note that it only works with compiled scripts


Hopefully it will help you

if not A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
   ExitApp
}

 Nick


1 person likes this

Nick

Thank you so much for your help.
I tested your version with the Enter key.
The problem is probably an authority issue.

Calling the created StartPowerJobs.exe only works with "Run as administrator".
The registered user is a member of the local administrator group of the computer. I can't explain why this doesn't work directly.

I also tested your first version with "Run as administrator". Also this version would have worked.

I am now looking for a way to solve the permission issue.

Thomas


Translated with www.DeepL.com/Translator

Thomas


I tried a different approach - the default action on the dialog box is the "OK" button, so I rewrote the script to "press the Enter key"


That worked correctly for me.


To test if this approach works with your set up, run powerJobs, wait for the dialog to appear, and press the Enter key. If it logs in to powerJobs/JobProcessor this approach should work


To implement this, comment out the ControlClick line (; at the start, and add the Sleep & Send lines as shown below 

;ControlClick, OK, %loginTitle%, %loginText%
Sleep, 1000 ; in milliSeconds 1000 = 1 second
Send {Enter}
 

 You may or may not need the delay, and may need to change the time which is in milliSeconds. For my system it was not needed 


Then recompile (it will overwrite the previous version) & try again

Good luck!


Nick

I tried it on 3 of our servers and it seems to work. Thank you for this solution. 

Nick, thank you for your reply.
Here are the screenshots of the login dialog box and the powerjobs dialog box.
Powerjobs runs on a Win10-VM with German operating system.
As you can see from the attached screenshots, the login dialog box is in English, but the Powerjobs dialog box is in German again.

Thomas

Brendan - good point about the server name, and you could also do the username & password using the same method.


I think that the ID of the control will be the same for all installations, but I'm wondering whether (based on Thomas' reply) there are differences from language to language


Nick

Thomas


"The program call works, but unfortunately the OK button in the login dialog is not executed."


I see one of your earlier posts is in German - are you using a German language version of Vault and/or Windows? I've only tried it with English


Can you post a screenshot of the login dialog box, and I'll see if I can make some suggestions


Nick

Thanks Nick - AutoHotKey works well.  Turns out it's also possible to change the server name as well, useful as an option for load balancing servers.  The first Control parameter for ControlSend may need to be regenerated using Window Spy.


 

powerJobsFolder := "C:\Program Files\coolOrange\powerJobs"

powerJobsExe := powerJobsFolder . "\powerJobs.exe"

loginTitle := "Settings"

loginText := "Administrator"

loginServer := "servername"


Run %powerJobsExe%, %powerJobsFolder%

WinWait %loginTitle%, %loginText%

WinActivate %loginTitle%, %loginText%

; Delete all the existing text in the Server input box

ControlSend, WindowsForms10.EDIT.app.0.ae0365_r6_ad13, {Home}{Shift Down}{End}{Shift Up}{Backspace 2}, %loginTitle%

; Type in the alternative Server name

ControlSend, WindowsForms10.EDIT.app.0.ae0365_r6_ad13, %loginServer%, %loginTitle%

;ControlClick , Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText

ControlClick, OK, %loginTitle%, %loginText%

Thank you for your suggestion.
I made the installation (AutoHotKey version 1.1.30.01) according to your instructions and copied the compiled exe to the autostart directory of the logged in user.
The program call works, but unfortunately the OK button in the login dialog is not executed.

Thomas

I've done this using AutoHotKey - https://www.autohotkey.com/


  • Download the latest installer & install AutoHotkey
  • Download the attached script
  • Right-click -> Compile Script
  • This will build StartPowerJobs.exe
  • You can then move it into your startup folder, or use another method to autorun it


Note that you need to run powerJobs manually and login with the correct user/password before this will work, 


Nick

ahk
(379 Bytes)

1 person likes this

Much needed function

Login or Signup to post a comment