WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

RunWithLogon versus RunAsUser

Keywords: 	  RunWithLogon versus RunAsUser

Question:

Is there an extender/function for changing the security context of the script (and any apps subsequently spawned by the script). I was unable to spawn such apps with the "Sfimpersonator", nor via Runas, since I dont want user intervention. I would prefer not to use "Sendkeys" if I dont have to. Thanks in advance.

Answer:

With current versions of WinBatch, you can use the RunWithLogon() function which makes use of the same service that the RunAs command uses on Win2K and WinXP. The RunWithLogon() function can only change the security context for the process that it creates to run a specific program, but it does not require any special rights to be granted to the user that calls this function.

For details on how the RunAs command works/restrictions in W2K and WinXP, see:

http://www.microsoft.com/windows2000/en/professional/help/windows_security_runas_shortcut.htm

With NT/2K/XP, you can also use the NT extender's wntRunAsUser() function to change the security context of the current process, for network connections to remote systems or for new processes created by the current process. The caveat is that the user that calls this function must have elevated rights on the system that are normally not granted to "normal" users.


Article ID:   W15560
File Created: 2003:05:13:11:28:52
Last Updated: 2003:05:13:11:28:52