Solved

Psexec and VB.net

Posted on 2013-05-14
3
1,461 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
Comment Utility
p.StartInfo.CreateNoWindow = True
0
 
LVL 1

Author Comment

by:AnthonySmithMCP
Comment Utility
That didnt work. The Window still comes up...
0
 
LVL 25

Assisted Solution

by:Ron M
Ron M earned 500 total points
Comment Utility
Is "cmd /c " necessary?
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

11 Experts available now in Live!

Get 1:1 Help Now