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

UAC

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

Admin Privilege OK in WinBatch, but not Compiled

 Keywords: UAC Manifest Administrator Runs differently 

Question:

I'm launching this tool "DebugView" from my script. It normally requires "Run as Administrator" when launching it manually for all features I need to be accessible ("Capture Global Win32" specifically).

When I run my script from WinBatch Studio, this works OK (even though I'm not doing anything special to run it as admin). When I compile it instead, DebugView is launched as if it had not received the administrative privilege.

Code snippet below:

Run( "Dbgview.exe", "/t /l debug.log" ) 
WinWaitExist("~DebugView", 5) 
SendMenusTo("~DebugView","Capture Capture Global Win32") 
DebugView itself is available here:

http://technet.microsoft.com/en- us/sysinternals/bb896647

Sorry, I can't keep this thing from breaking the URL.

Any ideas?

Answer:

You are probably launching WinBatch Studio from the PopMenu icon in the systray. If that's the case, PopMenu is already running elevated and so WinBatch Studio was launched in an elevated state, too, and so any new processes you start from within a script being executed by WinBatch Studio are running elevated.

However, when you run your compiled script, if you haven't explicitly run it as elevated and you haven't set the UAC manifest requirements to indicate that admin level elevation is required, then your script won't be running elevated and any processes that your script creates will also be running w/a restricted token. The proper solution is to go into the compiler settings for your script and configure it so that admin level elevation is required.


Article ID:   W18309
Filename:   Admin Privilege OK in WinBatch, but not Compiled .txt
File Created: 2011:02:01:13:59:34
Last Updated: 2011:02:01:13:59:34