Solved

Psexec and VB.net

Posted on 2013-05-14
3
1,562 Views
Last Modified: 2013-05-20
Hello,

I need help with a portion of my application. I'm trying to run psexec.exe from my vb.net application. Everything is working fine execpt when i run the command by clicking a button... The command Window will show executing the psexec command. However the application locks until the command is completed.

Anyone know how to run the psexec command without the entire application freezeing?

        Try
            Dim p As New Process()
            p.StartInfo.FileName = "C:\pstools\psexec.exe"
            p.StartInfo.Arguments = "\\" & TextBox1a.Text & " -s cmd /c c:\userMigration\scanstate.exe c:\%user% /o /all /c /i:migapp.xml /i:miguser.xml /i:migsys.xml /nocompress /localonly"
            p.Start()
            p.WaitForExit()
        Catch ex As Exception
            MessageBox.Show("Could not compete action")
        End Try

Open in new window



I think i answered my own question.. I just removed the "p.WaitForExit()". The command now runs without locking up... However do anyone know how to hide the command winodow while its running??
0
Comment
Question by:AnthonySmithMCP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
Ron Malmstead earned 500 total points
ID: 39165317
p.StartInfo.CreateNoWindow = True
0
 
LVL 1

Author Comment

by:AnthonySmithMCP
ID: 39165667
That didnt work. The Window still comes up...
0
 
LVL 25

Assisted Solution

by:Ron Malmstead
Ron Malmstead earned 500 total points
ID: 39165684
Is "cmd /c " necessary?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Easy filter aspnet 2 34
Code enhancement 4 33
How do I copy a form and rename it in VS2015 2 21
VB.NET System.NullReferenceException 1 19
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question