Forum Discussion
- srikanth2801ContributorHi,
Myself iam using win2000 OS and it is giving errors(script debuggign error).
using remove prgs link i got error atvar oExec = WshShell.Exec("RunDll32.exe shell32.dll," + "Control_RunDLL appwiz.cpl,,0");
i added the specified class DirectUIHWND with out "" in -- Open Applications | MSAA | List of accepted windows.
still it is giving the same type of error
using the uninstall prgs it is not having any items in "objectsList".
in this stmtobjectsList = wmiService.ExecQuery('SELECT * FROM Win32_Product ' + 'WHERE (Name="' + applicationName + '")');
and it is giving error atWScript.Echo('"' + applicationName + '" was not found');
saying WScript is not defined.
Thanks in advance - srikanth2801ContributorIn the Object Browser, Programs are not populating in Windows XP .
could any body please help me how to make the programs populated in that ADD/Remove programs in the object browser.
Also i want to do the same in windows 7 also
Thanks in Advance
Srikanth - Hi Srikanth,
using remove prgs link i got error at
var oExec = WshShell.Exec("RunDll32.exe shell32.dll," + "Control_RunDLL appwiz.cpl,,0");
We have checked this on several operating systems including Windows 2000 Server - this line doesn't give any errors. Below, is an operable script for Windows Server 2000:function Test()
{
var applicationName = "APPLICATION_NAME";
var buttonName = "Remove";
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("RunDll32.exe shell32.dll," + "Control_RunDLL appwiz.cpl,,0");
BuiltIn.Delay(5000);
Sys.Refresh();
var p = Sys.FindChild("CommandLine", "mshta.exe res://appwiz.cpl/default.hta");
if (!p.Exists)
{
Log.Error("The 'Add or remove programs' dialog was not found");
}
else
{
var w = p.FindChild("WndCaption", "Add/Remove Programs");
PropArray = new Array("innerText", "ObjectType");
ValuesArray = new Array(applicationName, "Cell");
var applicationCell = w.FindChild(PropArray, ValuesArray, 50);
if (!applicationCell.Exists)
{
Log.Error("The " + applicationName + " was not found");
}
else
{
applicationCell.Click();
PropArray[0] = "innerText"; PropArray[1] = "ObjectType";
ValuesArray[0] = "*"+buttonName+"*"; ValuesArray[1] = "Button";
applicationCell.parent.FindChild(PropArray, ValuesArray, 50).Click();
}
}
}
Exactly what error do you get?and it is giving error at
WScript.Echo('"' + applicationName + '" was not found');
There was an error in the script code. We've corrected it.
In the Object Browser, Programs are not populating in Windows XP .
could any body please help me how to make the programs populated in that ADD/Remove programs in the object browser.
Most probably, you have mistyped the class name. It must be exactly DirectUIHWND. - puyopuyContributorHi,
I did try the script to uninstall a program from Add/Remove Programs, everything is working as expected until I click the Remove button. The application that I want to remove will popup another window to confirm to uninstall, and I have to click Yes/No button. My problem is I can't match the process name for that popup window because it create dynamically and change every time when I click Remove button, the following is how it looks like.
GLF3CDGLF3CD
Any help is much appricated.
puyo - Hi puyo,
Try using the following code after the Remove button is clicked:var AW = Sys.Desktop.ActiveWindow();
while(aqString.Find(AW.WndCaption, "<Specify here the caption (or a part of the caption) of the pop-up window>") == -1)
{
AW = Sys.Desktop.ActiveWindow();
}
AW.Keys("y"); - puyopuyContributorThanks Allen, problem solved.
- jackson_1Frequent Contributorhi all,
are you guys test this script in windows 7 64 bit ?
and i want to use this function in windows 7 64 bit. anyone can help?
Thanks very much!
Hi,
The following script works with the 'Programs and Features' window in Windows 7:
function test()
{
var applicationName = "APPLICATION_NAME";
var bCaption = "Uninstall*";
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("RunDll32.exe shell32.dll," + "Control_RunDLL appwiz.cpl,,0");
Delay(15000);
Sys.Process("Explorer").Refresh();
var wnd = Sys.Process("Explorer").FindChild("WndCaption", "Programs and Features");
if (!wnd.Exists)
{
Log.Error("The 'Programs and Features' window was not found");
}
var programsList = wnd.FindChild("WndClass", "SysListView32", 20)
Log.Message(programsList.FullName);
programsList.ClickItem(applicationName, 0);
var propArray = new Array("Caption", "ObjectType")
var valuesArray = new Array(bCaption, "Button")
var button = wnd.FindChild(propArray, valuesArray, 20);
button.Click();
}- puyopuyContributor
Hi,
Need some help with original code.
Original:
var w = p.Window("NativeHWNDHost", "Add or Remove Programs", 1);var applicationWnd = w.FindChild("Caption", applicationName, 2);
if (!applicationWnd.Exists)
{
Log.Error("The " + applicationName + " was not found");
}else
{
while(4 > applicationWnd.ChildCount)
{
applicationWnd.Keys("[Down]");
applicationWnd.Refresh();
}
}....
I expected applicationWnd will hold the object of the application that I want to uninstall but how come the ChildCount will change after Key down and Refresh called?while(4 > applicationWnd.ChildCount)
{
applicationWnd.Keys("[Down]");
applicationWnd.Refresh();
}Thanks in advance.
Puyo
Related Content
- 5 months ago
- 4 years ago
Recent Discussions
- 2 days ago