Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 842685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:00:09+00:00 2026-05-15T06:00:09+00:00

In Executing Control Panel Items , MSDN says this: Windows Vista Canonical Names In

  • 0

In Executing Control Panel Items, MSDN says this:

Windows Vista Canonical Names

In Windows Vista and later, the preferred method of launching a Control Panel item from a command line is to use the Control Panel item’s canonical name.

According to the Microsoft website this should work:

The following example shows how an application can start the Control Panel item Windows Update with WinExec.

WinExec("%systemroot%\system32\control.exe /name Microsoft.WindowsUpdate", SW_NORMAL);

For Delphi 2010 I tried:

var
  CaptionString: string;
  Applet: string;
  Result: integer;
  ParamString: string;
CaptionString := ListviewApplets1.Items.Item[ ListviewApplets1.ItemIndex ].Caption;
if CaptionString = 'Folder Options' then
    { 6DFD7C5C-2451-11d3-A299-00C04F8EF6AF }
    Applet := 'Microsoft.FolderOptions'
  else if CaptionString = 'Fonts' then
    {93412589-74D4-4E4E-AD0E-E0CB621440FD}
    Applet := 'Microsoft.Fonts'
  else if CaptionString = 'Windows Update' then
    { 93412589-74D4-4E4E-AD0E-E0CB621440FD }
    Applet := 'Microsoft.WindowsUpdate'
  else if CaptionString = 'Game Controllers' then
    { 259EF4B1-E6C9-4176-B574-481532C9BCE8 }
    Applet := 'Microsoft.GameControllers'
  else if CaptionString = 'Get Programs' then
    { 15eae92e-f17a-4431-9f28-805e482dafd4 }
    Applet := 'Microsoft.GetPrograms'
//...

ParamString := ( SystemFolder + '\control.exe /name ' ) + Applet;
WinExec( ParamString, SW_NORMAL); <= This does not execute and when I trapped the error it returned ERROR_FILE_NOT_FOUND.

I tried a ExecAndWait( ParamString ) method and it works perfectly with the same ParamString used with WinExec:

ParamString := ( SystemFolder + '\control.exe /name ' ) + Applet;
ExecAndWait( ParamString ); <= This executes and Runs perfectly

The ExecAndWait method I used calls Windows.CreateProcess:

if Windows.CreateProcess( nil, PChar( CommandLine ), nil, nil, False, 0, nil, nil, StartupInfo, ProcessInfo ) then
  begin
    try

Does WinExec require a different ParamString, or am I doing this wrong with WinExec? I did not post the full ExecAndWait method but I can if someone wants to see it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:00:10+00:00Added an answer on May 15, 2026 at 6:00 am

    @Bill the WinExec function is deprecated,

    from MSDN Site

    this function is provided only for
    compatibility with 16-bit Windows.
    Applications should use the
    CreateProcess function

    try this sample using the CreateProcess function

    program ProjectTest;
    
    {$APPTYPE CONSOLE}
    
    uses
      Windows,
      SysUtils;
    
    var
      App        : String;
      Params     : String;
      StartupInfo: TStartupInfo;
      ProcessInfo: TProcessInformation;
    begin
      try
       App    := 'control.exe';
       Params := '/Name Microsoft.GetPrograms';
       FillChar(StartupInfo, SizeOf(StartupInfo), 0);
       StartupInfo.cb := SizeOf(StartupInfo);
       if not CreateProcess(nil, PChar(App+' '+Params), nil, nil, False, 0, nil, nil, StartupInfo, ProcessInfo) then
        RaiseLastOSError;
        //Readln;
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.