Solved

Psexec and VB.net

Posted on 2013-05-14
3
1,519 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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