Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Question regarding the title command  (Read 4776 times)

0 Members and 1 Guest are viewing this topic.

wolfess

  • Guest
Question regarding the title command
« on: August 26, 2005, 11:00:08 AM »
Can you do string concatenation  with the NT command 'title'?

I would like to concatenate the username (from %USERNAME%) with a title string.

Thanks,

Steve

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Question regarding the title command
« Reply #1 on: August 26, 2005, 01:38:29 PM »
Yup.

title %username%  Command Window

Put in any leading or trailing spaces you may need.

Hope this helps. 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

mikepan

  • Guest
Re: Question regarding the title command
« Reply #2 on: August 26, 2005, 01:48:11 PM »
*off topic
How do you reformat your computer, thank you for helping.

Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: Question regarding the title command
« Reply #3 on: August 26, 2005, 05:53:08 PM »
Hello Mikepan

Please don't ask a question about a different subject on someone else's post.  

Please post your question about formatting in the Windows forum if you intend formatting then re-installing a Windows OS.

If you intend just re-installing  a Dos OS then ask in the DOS forum.

Always, but always, give some info about your pc even if it's just to say what OS you are using.

Many thanks & looking forward to being of some help to you.
One good deed is worth more than a year of good intentions.

wolfess

  • Guest
Re: Question regarding the title command
« Reply #4 on: August 29, 2005, 06:04:00 AM »
Sidewinder,

   Excellent help you provided.  For those interested the following code works perfectly:

@echo off
cls
set _friendlyName=%username:.= %
set _titleString=6 MDG Logon Window -- Hello %_friendlyName%
@title %_titleString%

wolfess

  • Guest
Re: Question regarding the title command
« Reply #5 on: August 29, 2005, 06:06:49 AM »
Oh, one point of explanation.

cls
set _friendlyName=%username:.= %

::  The above code takes the dot out of the username
::  Our logon name format is fn.ln
::  The _friendlyName variable is a transform with
::  the dot replaced by a space

set _titleString=6 MDG Logon Window -- Hello %_friendlyName%
@title %_titleString%

Thnaks again for the help!   :)