By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!I'm after IDE.EXE's command line.I don't know what you're after. IDE retrieves its command line from the Windows GetCommandLine API, makes a copy, and parses that copy.
TCC has to name the EXE to run it. Task Manager shows what's pointed to by GetCommandLine(). How do you suppose this (below) happens.IDE does not edit its command line in place. What you see in Task Manager is the command line passed to IDE by TCC.
c:\program files\jpsoft\tcmd24>ide.exe E:\utils\GetCommandLine.btm
The String Address for the Command Line is: 1319122630
The Length of the Command Line is : 0
The Command Line is :
e:\utils>tccrt GetCommandLine.btm
The String Address for the Command Line is: -1914685700
The Length of the Command Line is : 22
The Command Line is : -1914685700
The String Address for the Command Line is: 1134704278
The Length of the Command Line is : 0
The Command Line is :
_x64: 1
_admin: 1
_elevated: 1
TCC 24.02.49 x64 Windows 10 [Version 10.0.18362.175]
TCC has to name the EXE to run it. Task Manager shows what's pointed to by GetCommandLine(). How do you suppose this (below) happens.
View attachment 2412
Moments later ...
View attachment 2413
If IDE.EXE isn't writing to GetCommandLine(), it must be magic.
My point was that you can make TaskMgr's command whatever you line by editing the string at GetCommandLine().I don't get your point; you're showing TCC and not IDE. IDE is an internal TCC command; TCC sticks the TCMD.INI arg and the batch file name on the command line and calls IDE.EXE. When you run something in IDE.EXE, the TCC parser embedded in IDE will change the title. Nobody writes directly to the string returned from GetCommandLine.
With TCC v24, it works on Win7/32.
Code:v:\> ver TCC 24.02.49 Windows 7 [Version 6.1.7601] v:\> \\jj\v$\gcl.btm The String Address for the Command Line is: 1515436 The Length of the Command Line is : 30 The Command Line is : g:\tc24\tcc.exe
v:\> echo ***%@wmi[.,"select CommandLine from Win32_Process where name = 'ide.exe'"]***
*** @"D:\tc24\TCMD.INI" myline.btm***
v:\> echo ***%@pstat[ide.exe,C]***
*** @"D:\tc24\TCMD.INI" myline.btm***
I could speculate. The help says
Reading that literally, it's interpreting GetCommandLine()'s value as a 32-bit quantity when it's really a 64-bit pointer. If the pointer is wrong, the length will be wrong (as you observed, me too). It just might be a fluke that your Win7 didn't go past 2^32 and Win10 does. And working its on Win7/32 would be no surprise.The return value is either a string value returned by the API (if BUFFER or aBUFFER is specified), or the integer value returned by the API.
@setlocal
@echo off
echo %@wmi[.,"select CommandLine from Win32_Process where name = 'ide.exe'"]
echo %cmdline
endlocal
ide.exe test.btm
TCC: (Sys) C:\Program Files\JPSoft\TCMD24\test.btm [3] The parameter is incorrect.
"%@wmi[.,"select CommandLine from Win32_Process where name = 'ide.exe'"]"
"C:\Program Files\JPSoft\TCMD24\test.btm"
ide.exe test.btm
test.btm
echo Using @wmi : %@wmi[.,"select CommandLine from Win32_Process where name = 'ide.exe'"]
echo Using cmdline : %cmdline
echo Using tasklist: %@word["@",-0,%@execstr[tasklist /l ide]]
echo Using WMIC : %@execstr[1,WMIC process where name="ide.exe" get Commandline]
TCC: (Sys) E:\Utils\getcommandline.btm [24] The parameter is incorrect.
"%@wmi[.,"select CommandLine from Win32_Process where name = 'ide.exe'"]"
Using cmdline : "E:\Utils\getcommandline.btm"
Using tasklist: "C:\Program Files\JPSoft\TCMD24\TCMD.INI" getcommandline.btm
Using WMIC : @"C:\Program Files\JPSoft\TCMD24\TCMD.INI" getcommandline.btm
e:\utils>getcommandline.btm
Using @wmi : @"C:\Program Files\JPSoft\TCMD24\TCMD.INI" getcommandline.btm
Using cmdline : getcommandline.btm
Using tasklist: "C:\Program Files\JPSoft\TCMD24\TCMD.INI" getcommandline.btm
Using WMIC : @"C:\Program Files\JPSoft\TCMD24\TCMD.INI" getcommandline.btm
e:\utils>which tasklist wmic
tasklist is an internal command
wmic is an external : C:\WINDOWS\System32\Wbem\wmic.exe