A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows 7 » Windows 7 Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

how to get the title into task manger 'window'?



 
 
Thread Tools Rate Thread Display Modes
  #31  
Old September 23rd 18, 05:08 PM posted to alt.msdos.batch,alt.windows7.general
Brian Gregory[_2_]
external usenet poster
 
Posts: 166
Default how to get the title into task manger 'window'?

On 19/09/2018 23:09, pyotr filipivich wrote:
how do I get "Administrator" to a) go away,


"Administrator:" shows it's running with elevated privileges (equivalent
to right click "Run as administrator".

Is that what you intended?

--

Brian Gregory (in England).
Ads
  #32  
Old September 23rd 18, 05:20 PM posted to alt.msdos.batch,alt.windows7.general
Brian Gregory[_2_]
external usenet poster
 
Posts: 166
Default how to get the title into task manger 'window'?

On 20/09/2018 20:58, Herbert Kleebauer wrote:
winmain::

Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (GetCommandLine)
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* Â*Â*Â*Â*Â*Â* ; skip program name
Â*Â*Â*Â*Â*Â*Â* eor.lÂ*Â* r1,r1Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* ; not within "" flag
Â*Â*Â*Â*Â*Â*Â* dec.lÂ*Â* r0
_20:Â*Â*Â* inc.lÂ*Â* r0
Â*Â*Â*Â*Â*Â*Â* cmp.bÂ*Â* #0,(r0)
Â*Â*Â*Â*Â*Â*Â* beq.bÂ*Â* _10
Â*Â*Â*Â*Â*Â*Â* cmp.bÂ*Â* #'"',(r0)
Â*Â*Â*Â*Â*Â*Â* bne.bÂ*Â* _30
Â*Â*Â*Â*Â*Â*Â* not.lÂ*Â* r1
_30:Â*Â*Â* or.lÂ*Â*Â* r1,r1
Â*Â*Â*Â*Â*Â*Â* bne.bÂ*Â* _20
Â*Â*Â*Â*Â*Â*Â* cmp.bÂ*Â* #' ',(r0)
Â*Â*Â*Â*Â*Â*Â* bne.bÂ*Â* _20
Â*Â*Â*Â*Â*Â*Â* inc.lÂ*Â* r0

_10:Â*Â*Â* move.lÂ* r0,-(sp)
Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (GetConsoleWindow)
Â*Â*Â*Â*Â*Â*Â* move.lÂ* r0,-(sp)
Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (SetWindowTextA)
Â*Â*Â*Â*Â*Â*Â* moveq.l #0,-(sp)
Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (ExitProcess)Â*Â* ; exit program


Is that really what Intel assembler looks like nowadays?

Looks more like Motorola 68000 assembler to me.

--

Brian Gregory (in England).
  #33  
Old September 23rd 18, 09:32 PM posted to alt.msdos.batch,alt.windows7.general
Kerr-Mudd,John
external usenet poster
 
Posts: 19
Default how to get the title into task manger 'window'?

On Sun, 23 Sep 2018 16:20:00 GMT, Brian Gregory
wrote:

On 20/09/2018 20:58, Herbert Kleebauer wrote:
winmain::

Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (GetCommandLine)
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* Â*Â*Â*Â*Â*Â* ;
skip program name Â*Â*Â*Â*Â*Â*Â* eor.lÂ*Â* r1,r1Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*
; not within "" flag Â*Â*Â*Â*Â*Â*Â* dec.lÂ*Â* r0
_20:Â*Â*Â* inc.lÂ*Â* r0
Â*Â*Â*Â*Â*Â*Â* cmp.bÂ*Â* #0,(r0)
Â*Â*Â*Â*Â*Â*Â* beq.bÂ*Â* _10
Â*Â*Â*Â*Â*Â*Â* cmp.bÂ*Â* #'"',(r0)
Â*Â*Â*Â*Â*Â*Â* bne.bÂ*Â* _30
Â*Â*Â*Â*Â*Â*Â* not.lÂ*Â* r1
_30:Â*Â*Â* or.lÂ*Â*Â* r1,r1
Â*Â*Â*Â*Â*Â*Â* bne.bÂ*Â* _20
Â*Â*Â*Â*Â*Â*Â* cmp.bÂ*Â* #' ',(r0)
Â*Â*Â*Â*Â*Â*Â* bne.bÂ*Â* _20
Â*Â*Â*Â*Â*Â*Â* inc.lÂ*Â* r0

_10:Â*Â*Â* move.lÂ* r0,-(sp)
Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (GetConsoleWindow)
Â*Â*Â*Â*Â*Â*Â* move.lÂ* r0,-(sp)
Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (SetWindowTextA)
Â*Â*Â*Â*Â*Â*Â* moveq.l #0,-(sp)
Â*Â*Â*Â*Â*Â*Â* jsr.lÂ*Â* (ExitProcess)Â*Â* ; exit program


Is that really what Intel assembler looks like nowadays?

Looks more like Motorola 68000 assembler to me.


Not quite, with those Â's in it!
Herbert prefers Motorola syntax.

But it's not complicated; this is what I think it'd be in nasm format:

xor bx,bx ;instr flag =false
dec si
_20:
inc si
cmp byte [si],0
jz _10
cmp byte [si],'"'
jne _30
not bx ; flag as instr
_30:
or bx,bx
jne _20
cmp byte [si],' '
jne _20
inc si
_10:

I'd make the first one a 'lodsb', then test al.
so
mov ah,0 ; quoted str flag off
nextc:
lodsb
cmp al,0
je havestr
cmp al,'"'
jne notaquote
mov ah,1
notaquote:
cmp ah,1
jne nextc
cmp al,0x20 ; space
jne nextc
inc si ; skip it
havestr:


--
Bah, and indeed, Humbug.
  #34  
Old September 23rd 18, 10:23 PM posted to alt.msdos.batch,alt.windows7.general
Herbert Kleebauer
external usenet poster
 
Posts: 27
Default how to get the title into task manger 'window'?

On 23.09.2018 17:22, pyotr filipivich wrote:

Again, execute the demo batch below (don't do any modification
to it). It will change the title and wait at the pause command,
so you can see the change of the title. After you press any key,
the pause command is skipped and the batch terminates, then cmd
resets the title to the old value.


Okay, I make this batchfile. It compiles a program
"SetTitle.exe", which because I was doing all this in C:\Sandbox, was
not found by ZZ Agent.Bat. So, I need to have this code compile to
c:\{PATH} so that the batchfile can find it?


I don't understand your problems.

Did you execute the posted batch code?

If No, we can stop here.

If you executed it, was the title changed to the new string
as long as the batch was executed (until you pressed a key)?

If No, we can stop here.

If the title was changed, then just add the line
settitle.exe my_new_title
at the beginning of your batch file.

But this only works, if the program settitle.exe is available
on your computer. You can either embed it in your batch file
(as done in the demo batch) or save the program (generated from
the demo batch) somewhere on your disk. If it is stored in
C:\Sandbox, then use

C:\Sandbox\settitle.exe my_new_title

in your batch file.

If it is stored in a directory which is listed in your %PATH%
variable or in the same directory as the batch file, then it is
sufficient to use:

settitle.exe my_new_title



certutil -f -decode %~f0 settitle.exenul


can I change this to
certutil -f -decode %~f0 c:\progs\settitle.exenul
and have it work? {I know, I know, I should try it and see. B-)}


You can, but if you already have it in C:\Sandbox then just
copy the exe to c:\progs, no need to decode it again.




Second question: is this invoked by

settitle.exe [New Title]

For use with other programs?


Settitle.exe can't be "used" with other programs. If settitle.exe
is executed from a batch file, it changes the title of the cmd window
until the batch terminates. It does not interact with any other programs
also executed in the same batch.




  #35  
Old September 24th 18, 09:17 AM posted to alt.msdos.batch,alt.windows7.general
Kerr-Mudd,John
external usenet poster
 
Posts: 19
Default how to get the title into task manger 'window'?

On Sun, 23 Sep 2018 20:32:43 GMT, "Kerr-Mudd,John"
wrote:
[]

I wasn't coding well last night - try this.

mov ah,0 ; inquotes_flag off
nextc:
lodsb
cmp al,0 ; null terminates
je havestr
cmp al,'"'
jne notaquote

xor ah,1 ; toggle inquotes_flag
jne nextc ; in string, carry on
notaquote:
cmp al,0x20 ; space ends unquoted string
jne nextc
havestr:





--
Bah, and indeed, Humbug.
  #36  
Old September 24th 18, 10:09 AM posted to alt.msdos.batch,alt.windows7.general
Herbert Kleebauer
external usenet poster
 
Posts: 27
Default how to get the title into task manger 'window'?

On 24.09.2018 10:17, Kerr-Mudd,John wrote:
On Sun, 23 Sep 2018 20:32:43 GMT, "Kerr-Mudd,John"
wrote:


I wasn't coding well last night


And also this morning?

The search terminates at the first space, independent
whether it is in or outside a quoted string.


mov ah,0 ; inquotes_flag off
nextc:
lodsb
cmp al,0 ; null terminates
je havestr
cmp al,'"'
jne notaquote

xor ah,1 ; toggle inquotes_flag
jne nextc ; in string, carry on
notaquote:
cmp al,0x20 ; space ends unquoted string
jne nextc
havestr:

  #37  
Old September 24th 18, 11:28 AM posted to alt.msdos.batch,alt.windows7.general
Kerr-Mudd,John
external usenet poster
 
Posts: 19
Default how to get the title into task manger 'window'?

On Mon, 24 Sep 2018 09:09:23 GMT, Herbert Kleebauer
wrote:

On 24.09.2018 10:17, Kerr-Mudd,John wrote:
On Sun, 23 Sep 2018 20:32:43 GMT, "Kerr-Mudd,John"
wrote:


I wasn't coding well last night


And also this morning?

The search terminates at the first space, independent
whether it is in or outside a quoted string.


mov ah,0 ; inquotes_flag off
nextc:
lodsb
cmp al,0 ; null terminates
je havestr
cmp al,'"'
jne notaquote

xor ah,1 ; toggle inquotes_flag
jne nextc ; in string, carry on
notaquote:
cmp al,0x20 ; space ends unquoted string
jne nextc
havestr:



Ah; fair enough. So much for me "improving" your code!

--
Bah, and indeed, Humbug.
  #38  
Old September 24th 18, 09:25 PM posted to alt.msdos.batch,alt.windows7.general
pyotr filipivich
external usenet poster
 
Posts: 752
Default how to get the title into task manger 'window'?

Brian Gregory on Sun, 23 Sep
2018 17:08:52 +0100 typed in alt.windows7.general the following:
On 19/09/2018 23:09, pyotr filipivich wrote:
how do I get "Administrator" to a) go away,


"Administrator:" shows it's running with elevated privileges (equivalent
to right click "Run as administrator".

Is that what you intended?


What I get/see is "Adminis..." on the task bar
the window title is "Administrator: batch-file title here"

What I'd like is to be able to look at the taskbar, and not see
"Admins...", either because it now reads "Ad: batch-file title here"
or just "batch-file title here"
--
pyotr filipivich
Next month's Panel: Graft - Boon or blessing?
  #39  
Old September 25th 18, 03:17 AM posted to alt.msdos.batch,alt.windows7.general
pyotr filipivich
external usenet poster
 
Posts: 752
Default how to get the title into task manger 'window'?

Herbert Kleebauer on Sun, 23 Sep 2018 23:23:50 +0200
typed in alt.windows7.general the following:
On 23.09.2018 17:22, pyotr filipivich wrote:

Again, execute the demo batch below (don't do any modification
to it). It will change the title and wait at the pause command,
so you can see the change of the title. After you press any key,
the pause command is skipped and the batch terminates, then cmd
resets the title to the old value.


Okay, I make this batchfile. It compiles a program
"SetTitle.exe", which because I was doing all this in C:\Sandbox, was
not found by ZZ Agent.Bat. So, I need to have this code compile to
c:\{PATH} so that the batchfile can find it?


I don't understand your problems.

Did you execute the posted batch code?


Yes.

If No, we can stop here.

If you executed it, was the title changed to the new string
as long as the batch was executed (until you pressed a key)?


I think so.

If No, we can stop here.

If the title was changed, then just add the line
settitle.exe my_new_title
at the beginning of your batch file.


Ah - thank you, that was the detail which was not intuitively
obvious.

But this only works, if the program settitle.exe is available
on your computer. You can either embed it in your batch file
(as done in the demo batch) or save the program (generated from
the demo batch) somewhere on your disk. If it is stored in
C:\Sandbox, then use

C:\Sandbox\settitle.exe my_new_title

in your batch file.

If it is stored in a directory which is listed in your %PATH%
variable or in the same directory as the batch file, then it is
sufficient to use:

settitle.exe my_new_title



certutil -f -decode %~f0 settitle.exenul


can I change this to
certutil -f -decode %~f0 c:\progs\settitle.exenul
and have it work? {I know, I know, I should try it and see. B-)}


You can, but if you already have it in C:\Sandbox then just
copy the exe to c:\progs, no need to decode it again.


Okay, will try that.




Second question: is this invoked by

settitle.exe [New Title]

For use with other programs?


Settitle.exe can't be "used" with other programs. If settitle.exe
is executed from a batch file, it changes the title of the cmd window
until the batch terminates. It does not interact with any other programs
also executed in the same batch.


Okay. Sorry, I should have said "other batch files."



--
pyotr filipivich
Next month's Panel: Graft - Boon or blessing?
  #40  
Old October 6th 18, 06:57 PM posted to alt.msdos.batch,alt.windows7.general
pyotr filipivich
external usenet poster
 
Posts: 752
Default SetTitle.exe worked as advertised, thanks how to get the title into task manger 'window'?

pyotr filipivich on Mon, 24 Sep 2018 19:17:44
-0700 typed in alt.windows7.general the following:
Herbert Kleebauer on Sun, 23 Sep 2018 23:23:50 +0200
typed in alt.windows7.general the following:
On 23.09.2018 17:22, pyotr filipivich wrote:

Again, execute the demo batch below (don't do any modification
to it). It will change the title and wait at the pause command,
so you can see the change of the title. After you press any key,
the pause command is skipped and the batch terminates, then cmd
resets the title to the old value.

Okay, I make this batchfile. It compiles a program
"SetTitle.exe", which because I was doing all this in C:\Sandbox, was
not found by ZZ Agent.Bat. So, I need to have this code compile to
c:\{PATH} so that the batchfile can find it?


I don't understand your problems.

Did you execute the posted batch code?


Yes.

If No, we can stop here.

If you executed it, was the title changed to the new string
as long as the batch was executed (until you pressed a key)?


I think so.

If No, we can stop here.

If the title was changed, then just add the line
settitle.exe my_new_title
at the beginning of your batch file.


Ah - thank you, that was the detail which was not intuitively
obvious.

But this only works, if the program settitle.exe is available
on your computer. You can either embed it in your batch file
(as done in the demo batch) or save the program (generated from
the demo batch) somewhere on your disk. If it is stored in
C:\Sandbox, then use

C:\Sandbox\settitle.exe my_new_title

in your batch file.

If it is stored in a directory which is listed in your %PATH%
variable or in the same directory as the batch file, then it is
sufficient to use:

settitle.exe my_new_title



certutil -f -decode %~f0 settitle.exenul


can I change this to
certutil -f -decode %~f0 c:\progs\settitle.exenul
and have it work? {I know, I know, I should try it and see. B-)}


You can, but if you already have it in C:\Sandbox then just
copy the exe to c:\progs, no need to decode it again.


Okay, will try that.




Second question: is this invoked by

settitle.exe [New Title]

For use with other programs?


Settitle.exe can't be "used" with other programs. If settitle.exe
is executed from a batch file, it changes the title of the cmd window
until the batch terminates. It does not interact with any other programs
also executed in the same batch.


Okay. Sorry, I should have said "other batch files."


It worked as advertised.

I did have to mess with %path% and some other details, but it
works now!

Thanks.
--
pyotr filipivich
Next month's Panel: Graft - Boon or blessing?
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 12:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.