Solved

Psexec and VB.net

Posted on 2013-05-14
3
1,492 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 M 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 M
Ron M earned 500 total points
ID: 39165684
Is "cmd /c " necessary?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now