Solved

WinGUI log-out user (switch user)

  • 18 November 2021
  • 3 replies
  • 36 views

Badge

We would like to automatically log-out a user at the end of a process flow that is initiated by the same user. If it is not possible to do so automatically, is there an option to switch accounts within the application, without closing and opening the application. 

We have thought about alternative options as well such as a windows batch (.bat) file that closes and opens the application automatically. Is it possible to trigger such a script within the TW application?  Triggering such a script with a specific key binding outside of the TW application does not work well in widows.

icon

Best answer by Henk-Jan van Laar 18 November 2021, 14:19

View original

3 replies

Userlevel 6
Badge +18

Hi Philip,

We would like to automatically log-out a user at the end of a process flow that is initiated by the same user

That is indeed not possible as we currently don't have such process flow action. Feel free to create an idea for this:smile:

 If it is not possible to do so automatically, is there an option to switch accounts within the application, without closing and opening the application. 

Not in the usual way. The true logged-in user cannot be switched as the application is opened and tailored to the user that is logged in. You could build a way of logging in inside your application. This does require some clever coding and modelling, but some customers are already doing it like this. 

This is limited as it is not possible to have different roles and rights between users as the true logged-in user doesn't change - just the operator.

We have thought about alternative options as well such as a windows batch (.bat) file that closes and opens the application automatically. Is it possible to trigger such a script within the TW application?

In the Windows GUI we do allow Windows command tasks to be executed. This can call an external program or batch file like you mentioned. The docs tells some more about it: Tasks | Thinkwise Documentation (thinkwisesoftware.com)

Userlevel 2
Badge +1

Hi Philip,

 

I was curious to try this and it works pretty well:

  1. Make a task in the SF that uses ‘Windows Command‘ as the logic type and assign it to a table or menu
  2. Give it an object name with brackets (e.g. “[bat_file_location”]
  3. Give it a parameter with the same name as the object name, but without the brackets (e.d. “bat_file_location”)
  4. Give the parameter a default value with the location of the .bat file (e.g. “c:\temp\file.bat”), maybe use an expression default if the path is very long or calculated
  5. put the following inf the bat file:
    1. taskkill /im tsf_dotnet.exe
    2. start \\...\Windows\TSF_CS.exe "\\...\ini\name.ini"

this will kill all instances of the GUI, you might be able to tweak some things in taskkill

You can also directly call cmd.exe with some parameters, I didn’t try that though

Badge

Thanks for the very helpful replies!

I was able to create such a task, I’ll only have to add it to the process flows.

I ended up using the following batch file:
 

taskkill /im tsf_dotnet.exe


sleep 1

@ECHO OFF
SETLOCAL
start "" "C:\Thinkwise GUI\TSF_CS_run_dev.lnk"

GOTO :EOF

Reply