我需要在bat文件中运行的“Las2xyz”进程的进程ID。

我怎样才能做到这一点?我不能使用最后一个RUN ID或第一个ID,我需要实际的进程ID,因为在给定的时间有多个运行并且在给定的时间结束,我无法对其进行猜测。

这是我的批次:

@echo off
@echo off
set PATH=C:\Windows\system32;C:\atlass\las2xyz;C:\atlass\las2xyz\bin;C:\atlass\las2xyz\lib
set TOP_HOME=%C:\atlass\las2xyz%
del dat*.xyz dat*.seg dat*.pat dat*.tmp dat*.txt test.nam
las2xyz.exe "[ flightpath 2 out 5 lasformat 1 target 0 FIXCLASS 1 step 20 unit *METRIC* fov 20.0 rollfix 1   sn_number *H68_038-003* lsystem *LIDAR_1* DESTSYS 144 minele -100.00 maxele 6000.00 hoff 0.00 eoff 0.00 noff 0.00 bootnr 13110201 leg 1]" "C:\Users\Developer-One\Desktop\las2xyz_Data\131102_003243_GPE.sdc" , "\\192.168.0.102\agis\Macquarie_Barwon_1310\Area_01\sbet_038_13110201.out" - "131102_003243_cov"

有人告诉我该怎么做!
谢谢你

最佳答案

这将启动可执行文件并获取PID:

@echo off
for /f "tokens=2 delims==; " %%a in (' wmic process call create "notepad.exe" ^| find "ProcessId" ') do set PID=%%a
echo "%PID%"
pause

关于windows - 获取在Bat文件中运行的exe的进程ID,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21618914/

10-14 16:56