Ask a Question

regedit.exe and TestExecute

m_essaid
Valued Contributor

regedit.exe and TestExecute

Hi,

I experience some issue with a .reg file that needs to be executed at a moment of my tests.

I have a new machine (physical machine) and when the .reg file is run TestExecute don't interact with the "Yes" and the "OK" button.

Please help...

Thank you,

Mehdi

5 REPLIES 5
cunderw
Community Hero

It might make more sense to create a batch file that you can execute from script code as opposed to trying apply the reg through regedit UI. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
m_essaid
Valued Contributor

hi @cunderw,

 

you may be right, but I'm working like this since quite a long time...

I finaly figured out what was happening :

I was trying to run my tests on a machine with another account.

I went back to the Admin account, and in the main user of regedit.exe, instead of "trusted installer" I changed this value to my new user... And this works.

But I think that I should reformat this machine and use directly my new user as admin, it would be simplier.

Glad you figued it out, if you would like some help with creating a batch script to do it instead just let me know! 🙂


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

 

Hello!

Try using reg.exe instead of regedit.exe

For example (JScript):

var sRegFile = "[path_to_reg_file]\\test.reg";

if ( aqFile.Exists(sRegFile) ) {
  Log.Message("Registy file was found.");
  var WshShell, WshShellExec;
  WshShell = Sys.OleObject("WScript.Shell");
  WshShellExec = WshShell.Exec("C:\\Windows\\system32\\reg.exe import " + sRegFile);
  Delay(1000);  //some delay (if needed)
  if ( WshShellExec.ExitCode == 0 ) {
    Log.Message("The reg file was imported successfully.");
  } else {
    Log.Error("Importing the reg file failed.");
  }
} else {
  Log.Warning("Registy file was not found!");
}

 

Hey @Satan_Claus

yes that's what I understood this morning.

the script could be also :

 

  TestedApps.Clear;
  TestedApps.Add('C:\WINDOWS\system32\reg.exe', '', 1, true, 'C:\WINDOWS\system32');
  TestedApps.reg.Params.SimpleParams.CommandLineParameters:= 'import c:\yourRegFile.reg';
  TestedApps.reg.Params.SimpleParams.Activate;
  TestedApps.reg.Run(1, true);

cancel
Showing results for 
Search instead for 
Did you mean: