Forum Discussion
HKosova
14 years agoSmartBear Alumni (Retired)
Hi Rajesh,
You can import a .reg file into the registry programmatically by executing the reg import command:
In scripts, you can run this command using the WshShell.Run method, like this:
Note that if you are using Windows 7 or Vista with UAC enabled, you may need to run TestComplete as an administrator in order for the reg import command to be executed successfully (see Testing Applications With TestComplete Under Windows Vista and Later Operating Systems).
You can import a .reg file into the registry programmatically by executing the reg import command:
reg import <path>\MyFile.reg
In scripts, you can run this command using the WshShell.Run method, like this:
Dim oShell, strFileName, iExitCode
' Get the name and path of the .reg file in Stores
strFileName = Files.FileNameByName("MyRegFile")
Set oShell = Sys.OleObject("WScript.Shell")
iExitCode = oShell.Run("reg import """ & strFileName & """")
If iExitCode = 0 Then
Log.Message "The Reg file was imported successfully."
Else
Log.Error "Importing the reg file failed."
End If
Note that if you are using Windows 7 or Vista with UAC enabled, you may need to run TestComplete as an administrator in order for the reg import command to be executed successfully (see Testing Applications With TestComplete Under Windows Vista and Later Operating Systems).
Related Content
- 5 years ago
- 9 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago