Ask a Question

Open Panel Control with TestComplete


Open Panel Control with TestComplete

Hello to everyone, I have a little program. I have to check the ethernet connection between my product and the software under test. To do it I have to set the ethernet configuration and to do it I have to open Panel Control -> Network and sharing center -> .... How could I open the Panel Control with TestComplete?

Thanks in advance


Regular Contributor

You could try this cmd to launch Network and Sharing: 


all you'd have to do is save that off in a 'networkSharing.bat' file > save it in your Project's Stores/Files folder > then run it from a TestComplete script like so:

function launchNetworkSharing() {
  var batch = Sys.OleObject("WScript.Shell");  
  var run = batch.Run(Project.Path + "\\Stores\\Files\\networkSharing.bat");
  var networkSharing = Sys.Process("explorer", 2).Window("CabinetWClass", "Network Connections", 1);
    Log.Checkpoint("| Network & Sharing Launched |");
    // do some other stuff if you need to

** I don't have a Desktop license so I can't tell if TestComplete will be able to find the objects within the Network and Sharing options, but this should at least take care of the how to get to Network & Sharing. 


If TC can't find the objects within, you might be stuck writing your own PoswerShell script or similar, like [this].  

[[ kITt: keep IT testing ]]
Champion Level 2

What OS are you using? What exactly are you configuring or verifying?


I ask, because you might be able to use the Command Prompt to achieve what you need to do.

Windows 10 Pro. I will try with the Command Prompt

Thank you

Thank you very much for your kindness! We have some TestedApps that are batch files, do you think that I can create a batch file and then launch it? Could it works?

Thank you very much

Champion Level 2

TestedApps and batch file is possible, but it all depends on what you are configuring or verifying? There may be standard Windows Commands you can use, or you might have to use PowerShell

Which Windows Commands do you recommend to use?

Champion Level 2

I don't know yet, as you still haven't specified what you are verifying!


The title mentions "opening control panel...".


You mention, "check the ethernet connection between my product and the software under test" - How are you doing this?


Also, you mention, "I have to set the ethernet configuration" - How are you doing this?



Sorry. I have to open Panel Control to set the IP address and the Subnet Mask.

Champion Level 2

Now that we know what you are doing, you can use command prompt which is easier to automate. See Set static IP address on Windows 10 from Command Prompt, you can use the command "netsh" and invoke the command and get the output like so,

function Test()
    var oExec = WshShell.Exec("netsh interface ip set address name=\"Ethernet1\" static");
    while (oExec.Status == 0) {
    while (!oExec.StdOut.AtEndOfStream) {


Showing results for 
Search instead for 
Did you mean: