zoukankan      html  css  js  c++  java
  • 如何获得一个进程的命令行参数?

    Option Explicit

    Private Sub Form_Load()
        getProcessCommandLine
    " notepad.exe "
    End Sub

    Private Sub getProcessCommandLine(ByVal proName As String )
       
    Dim objWMIService As Object
       
    Dim colProcessList As Object
       
    Dim objProcess As Object
       
    Dim objProType As Object
       
    Set objWMIService = GetObject ( " winmgmts: " & " {impersonationlevel=impersonate}!\\.\root\cimv2 " )
       
    Set colProcessList = objWMIService.ExecQuery( " Select * from Win32_Process Where Name=' " & proName & " ' " )
       
       
    If colProcessList.Count <> 0 Then
           
    For Each objProcess In colProcessList
               
    For Each objProType In objProcess.Properties_
                   
    If objProType.Name = " CommandLine " Then
                        MsgBox objProType.Value
                       
    Exit For
                   
    End If
               
    Next
           
    Next
       
    End If
    End Sub

  • 相关阅读:
    第九周学习进度
    用户场景描述
    第九天
    第10天
    求两个有序数组的中值
    计算字符串中最长子字符串的长度
    计算两个数之和
    将string 转int
    判断一个int 型整数 是否为回文数
    php 对象的一些特性
  • 原文地址:https://www.cnblogs.com/sysdzw/p/1939353.html
Copyright © 2011-2022 走看看