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

  • Home
  • SEARCH
  • 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 906563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:24:29+00:00 2026-05-15T16:24:29+00:00

I am converting an old cmd command to Powershell, and currently use: START My

  • 0

I am converting an old cmd command to Powershell, and currently use:

START "My Title" Path/To/ConsoleApp.exe

This works as expected to launch ConsoleApp with My Title as it’s window title. This has been replaced with Start-Process which works correctly, but does not provide a mechanism to change the title.

Is there another way to do this without resorting to using the cmd command?

  • 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-15T16:24:29+00:00Added an answer on May 15, 2026 at 4:24 pm

    There is a small quirk when changing the text of the process’ main window: if you try to change the text straight after you have started the process, it may fail due to one of many possible reasons (e.g. the handle to the control which displays the text does not exist at the time of the function call). So the solution is to use the WaitForInputIdle() method before trying to change the text:

    Add-Type -TypeDefinition @"
    using System;
    using System.Runtime.InteropServices;
    
    public static class Win32Api
    {
        [DllImport("User32.dll", EntryPoint = "SetWindowText")]
        public static extern int SetWindowText(IntPtr hWnd, string text);
    }
    "@
    
    $process = Start-Process -FilePath "notepad.exe" -PassThru
    $process.WaitForInputIdle()
    [Win32Api]::SetWindowText($process.MainWindowHandle, "My Custom Text")
    

    Be aware that the application itself can still change the window text after you have made your own change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently in the process of converting old Web 1.0 code to meet
We are currently converting our old base VB.Net to C #. Converting the bulk
I've got a bit of a problem. I'm currently working on converting an old
I am currently converting a very old, but working classic ASP site to ASP.Net.
I'm working on converting an old C program (currently run on UNIX) into our
I'm converting double to float using ye old float myFloat = (float)myDouble . This
I inherited this old TurboBasic code base, and I am converting it to something
I am converting an old dataset into a newly structured database. Currently they have
I'm converting some old RealMedia audio-only files to use with the SWFOBJECT Flash player
I'm having some difficulties converting this old mailer api to rails 3: content_type multipart/mixed

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.