[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 一个wmic取值问题求助,谢谢

  1. @echo off&setlocal enabledelayedexpansion
  2. for /f "delims=" %%a in ('wmic process get ExecutablePath^,Processid /value^|find "="') do (
  3.   set "%%a"
  4.   echo !ExecutablePath! !Processid!
  5. pause>nul
  6. )
复制代码
我想给ExecutablePathhe Processid分别赋值,为啥结果打印出来是下面这样呢?ExecutablePath的路径怎么被截断了呢?
ECHO 处于关闭状态。
0
0
4
4
308
308indows\system32\csrss.exe
496indows\system32\csrss.exe
496indows\system32\wininit.exe
592indows\system32\wininit.exe
592indows\system32\services.exe
648indows\system32\services.exe
648indows\system32\lsass.exe
664indows\system32\lsass.exe
664indows\system32\lsm.exe
672indows\system32\lsm.exe
672indows\system32\svchost.exe
764indows\system32\svchost.exe
764rogram Files\NVIDIA Corporation\Display.NvContainer\NVDisplay.Container.exe
864rogram Files\NVIDIA Corporation\Display.NvContainer\NVDisplay.Container.exe
864indows\system32\svchost.exe
924indows\system32\svchost.exe
924indows\System32\svchost.exe
1008ndows\System32\svchost.exe
1008ndows\System32\svchost.exe
200indows\System32\svchost.exe

wmic有自己的格式,在加载一次就好了
/zhqsystem/zhq 发表于 2018-7-11 15:37



    再加载一次是什么意思?我下面再去调用这个变量的时候是出错的,求指点

TOP

返回列表