Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Control Panel Applets .cpl wntRunAs RunAs RunwithLogon Problem Launching Run Running
prog = "control.exe" prog_params = "ncpa.cpl" runas_user ="administrator" runas_domain = "" runas_pswd = "password" Run (prog, prog_params) RunWithLogon(prog, prog_params, "", @NORMAL, @NOWAIT, runas_user, runas_domain, runas_pswd,0)The first simple RUN opens up the right window.
The RunWithLogon opens up a window displaying the contents of the C:\ drive. By the way, I can directly launch other control panel applets using RunWithLogon, except the Network Connection applet does not open with the right window ???
I seem to recall reading a note some time ago stating that RunWithLogon() cannot be used to directly launch a control panel applet. I'm not sure what the root cause of the problem was, but I do recall reading about it.
How about using Script A to run Script B via RunWithLogon(), and then have Script B launch the control panel applet via the Run() function.
Here's the URL for the full discussion and a listing of some work arounds that should solve the problem.
http://blogs.msdn.com/aaron_margosis/archive/2004/07/07/175488.aspx
I would recommend that the URL and some of its contents be placed into the tech support database for future reference, including being tagged with the keywords "RunAs", "RunWithLogon", "ncpa.cpl", "network connections" and "control panel".
Article ID: W17038
File Created: 2007:07:03:14:27:48
Last Updated: 2007:07:03:14:27:48