簡體   English   中英

PSTools和VB.net:系統找不到指定的文件

[英]PSTools and VB.net: The system cannot find the file specified

我正在嘗試編寫一個用於工作的程序,它將能夠告訴我是否有人登錄了多台PC。

我正在使用PStool的PSloggedon cmd。

這是我正在嘗試的代碼:

私有子Button1_Click(發送為System.Object,發送為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的PS Im

采用

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

32位系統命令

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM