Issue when use PSExec + Tasklist?

Evvivame Evvivame 20 Reputation points
2023-12-26T11:35:06.4566667+00:00

As you know, the NTVDM is an emulator to run 16bit app on Windows 32bit

My Test.bat (as mininmal) is:

for /F "tokens=1,2" %%i in ('tasklist /FI "IMAGENAME eq NTVDM.EXE" /fo table /nh') do set pid=%%j

tasklist.exe /v | find /i "%PID%" > Tasklist.txt

After run test.bat on my PC, the Tasklist.txt contains the correct value:

ntvdm.exe 3484 Console 1 24.896 K Running PESA\user 0:00:05 SILVA

Where SILVA is the 16bit module name.

If I execute test.bat with PSExec \xx.xx.xx.xx -u user -p yyyy, I found in Tasklist.txt an incorrect content like this:

ntvdm.exe 3484 Console 1 24.900 K Unknown PESA\user 0:00:05 N/D

As you can see the 16bit module name (SILVA) is loss !!

Some suggestion?

Thanks

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,064 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 35,511 Reputation points
    2023-12-26T14:30:31.2666667+00:00

    Have psexec run the bat file as the system account with the -s switch.

    psexec \\test10 -s -u admin -p admin -c test.bat
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Evvivame Evvivame 20 Reputation points
    2023-12-26T15:27:20.9+00:00

    Thanks for answer !

    I try, without success, the option -s although the user is the only user on this system and it has administrator rights


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.