Share via

Get command response

OSVBNET 1,401 Reputation points
2021-05-12T12:51:18.303+00:00

Hey,
I wanna perform a query from within VB.NET and wonder how to check the response?!

System.Diagnostics.Process.Start("fsutil", "behavior query disabledeletenotify")

Thanks for the help :)

Developer technologies | VB
0 comments No comments

2 answers

Sort by: Most helpful
  1. Karen Payne MVP 35,606 Reputation points Volunteer Moderator
    2021-05-15T02:45:10.33+00:00

    As mentioned by @Dewayne Basnett look at ProcessStartInfo setting RedirectStandardOutput and if you do not want to see the console window CreateNoWindow = True. To get any output see the following code block which in this case runs PowerShell command and redirects to a file, file is read and output is presented in a Windows Form. The text file can then be deleted. Lastly, WaitForExitAsync is used to keep the application responsive while wait for the external process to finish. If you like, code can be added to cancel the operation if it's taking too long using a CancellationTokenSource.

    Was this answer helpful?

    0 comments No comments

  2. Dewayne Basnett 1,386 Reputation points
    2021-05-12T13:38:13.907+00:00

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.