【问题标题】:PSTools and VB.net: The system cannot find the file specifiedPSTools 和 VB.net:系统找不到指定的文件
【发布时间】:2014-01-08 04:51:58
【问题描述】:

我正在尝试为工作编写一个程序,它能够告诉我一个人是否登录了多台 PC。

我正在使用 PStool 的 PSloggedon cmd。

这是我正在试验的代码:

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) 处理 Button1.Click

    Dim Proc As New System.Diagnostics.Process
    Proc.StartInfo = New ProcessStartInfo("psLoggedon")
    'right now the textbox will hold a PC ID from a list of PC's in a database.
    Proc.StartInfo.Arguments = "-l \\" & TextBox1.Text & ""
    Proc.StartInfo.RedirectStandardOutput = True
    Proc.StartInfo.UseShellExecute = False
    Proc.StartInfo.CreateNoWindow = True
    Proc.Start()



    MsgBox(Proc.StandardOutput.ReadToEnd)



    Proc.Close()



End Sub

但我得到了这个错误:

Win32Exception 未处理: 系统找不到指定的文件

我在这里检查过:
C:\Windows\System32

并确保将应用程序文件复制到那里。

有人可以帮我解释一下我可以做些什么来解决这个问题吗?

附言我使用的是 Windows 7

【问题讨论】:

    标签: vb.net cmd


    【解决方案1】:

    使用

    string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Windows) + "\\sysnative";
    

    32 bit system command

    【讨论】:

    • 我将在何处以及如何使用此语句?
    • 在 Proc.StartInfo 之前
    • 实际上您发布的文章有所帮助。我所做的只是将 PStools 应用程序文件复制到 \windows\syswow64 中,谢谢!
    猜你喜欢
    • 1970-01-01
    • 2013-11-21
    • 2023-03-17
    • 2017-12-21
    • 2015-09-28
    • 2015-11-08
    • 2018-08-26
    • 2019-01-20
    相关资源
    最近更新 更多