越来越EXE运行的进程ID在bat文件 [英] getting process ID of exe running in Bat File

查看:129
本文介绍了越来越EXE运行的进程ID在bat文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的bat文件正在运行Las2xyz进程的进程ID。

I require the Process id of the "Las2xyz" process that's being run in my bat file.

我怎样才能做到这一点?我不能使用上次运行ID或第一个ID,我需要实际的进程ID,因为有多个运行,这些在任何给定时间,在任何给定的时间结束了,我不能guessimate它。

How can i achieve this? I can't use the last RUN ID or the first ID, I need the actual process ID, as there are multiple of these running at any given time and ending at any given time i cannot guessimate it.

这是我的批处理:

@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"

有人告诉我该怎么办呢!
谢谢

Someone show me how to do it! thank you

推荐答案

这将启动一个可执行文件,并获得PID:

This will launch an executable and get the 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

这篇关于越来越EXE运行的进程ID在bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆