Highlighted
Alan Abreu Absent Member.
Absent Member.
167 views

How Can I Programatically Launch An App Via Start Menu

I need to verify that I can launch various apps thru the Start menu. The following works to select 'Start -> All Programs':

Window("Window").WinButton("start").Click
Window("Window").Window("Start Menu").WinButton("All Programs").Click

At this point, I'm stuck. I'm not sure how to program QTP to select the path to the various apps. Recording doesn't generate anything. Any ideas?

- Thanks
0 Likes
4 Replies
Manoj Patra Absent Member.
Absent Member.

Re: How Can I Programatically Launch An App Via Start Menu

use SystemUtil.Run statement in your script
Ex: To open notepad you write
SystemUtil.Run "-notepadpath-\notepad.exe"
0 Likes
Alan Abreu Absent Member.
Absent Member.

Re: How Can I Programatically Launch An App Via Start Menu

Thanks Manoj.

I know I can do that but I actually need to verify that the program can be invoked by physically selecting it through the Start menu.

I'm not sure how to do that.
0 Likes
Cody Marcel Absent Member.
Absent Member.

Re: How Can I Programatically Launch An App Via Start Menu

The start menu is just a link or pointer to the executable of the application. If you veryify that the link exists and is correct, it would be the same as physically clicking on it. This is the directory that Windows uses to build the start menus. If you use that as the application path on the SystemUtil.Run function.


C:\Documents and Settings\All Users\Start Menu\Programs\

0 Likes
Alan Abreu Absent Member.
Absent Member.

Re: How Can I Programatically Launch An App Via Start Menu

Thanks Cody. That makes sense. The only problem now is that the shortcuts for our app include the .exe at the end of the name and that doesn't seem to work.
For example, copy a shortcut to Notepad into C:\Temp, then rename the shortcut to Notepad.exe, then try the following:

SystemUtil.Run "C:\Temp\Notepad.exe"

An 'Invalid procudre call or argument' msg appears.

I'm going to suggest we remove the extensions from the shortcut names anyway, but beyond that, is there a way around this?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.