如何存储命令的结果并解析它 [英] How to store result of a command and parse it

查看:66
本文介绍了如何存储命令的结果并解析它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用命令提示符执行此操作:

I am trying to do this using command prompt:

我正在尝试使用dos提取应用程序池的进程ID。我正在使用appcmd list wps /apppool.name:DefaultAppPool,但我得到的结果是格式为WP" 1234" <程序池:默认应用取代。我想将此输出存储在变量中,
解压缩1234并将其传递给另一个命令。

如何存储和提取?

I'm trying to extract the process ID of an app pool using dos. I'm using appcmd list wps /apppool.name:DefaultAppPool but the result I get is in the format WP "1234" <apppool:DefaultAppPool>. I want to store this output in a variable and extract the 1234 and pass it to another command.
How do I store and extract?

推荐答案

我正在尝试使用dos提取应用程序池的进程ID。我正在使用appcmd list wps /apppool.name:DefaultAppPool,但我得到的结果是格式为WP" 1234" <程序池:默认应用取代。我想将此输出存储在一个变量中,
解压缩1234并将其传递给另一个命令。

如何存储和提取?
I'm trying to extract the process ID of an app pool using dos. I'm using appcmd list wps /apppool.name:DefaultAppPool but the result I get is in the format WP "1234" <apppool:DefaultAppPool>. I want to store this output in a variable and extract the 1234 and pass it to another command.
How do I store and extract?


这篇关于如何存储命令的结果并解析它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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