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.

Using the wntRunAsUser Function Twice in a Script

Keywords: 	  wntRunAsUser

Question:

From a Domain User Metaprame session, I am successfully issuing wntRunAsUser(changing to Administraor), assigning admin rights to the user, wntRunAsUser(changing back to normal user), then issue a 'Run' of c:\install.exe. I seem to have sufficient authority to run this install.exe (after resetting rights) outside of Winbatch, but if I try to run it from within Winbatch, I get an '1932: Access denied' error message. What is keeping me from running this program??

Any ideas?

Answer:

  1. What version of WinBatch are you using?

  2. There are some *interesting* problems in trying to do wntRunAsUser twice in one script. I *think* new versions of the WWWNT34I.DLL and WBDCC34I.DLL help solve this problem. So download the latest Winbatch, install, then make sure all copies of those two DLLs you can find are the save time/date/size as the downloaded copies. (Making Large EXE's does not necessarily solve this problem)

  3. Another workaround is that there are two scripts (although if you are clever enough you can have a single physical wbt/exe file that pretends to be two scripts). The first script start up and immediately RUNWAIT's the second script

    The second script does the wntRunAsUser and makes the required changes, then exits. At that point the first script can pick up again.


Article ID:   W14650
Filename:   wntRunAsUser Function Used Twice in Script.txt
File Created: 2001:03:01:14:21:10
Last Updated: 2001:03:01:14:21:10