• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

Hide spawned process window?

I'm pretty new to VB.NET, so bear with me, please..  I am trying to spawn a process that runs at a command line (Ping, for example), but I need to hide the window so it doesn't pop up and then go away..  This process gets called 4 times in succession, and flashes up and down, making the UI very ugly.

Here's what I have so far:


dim myproc as new process
dim startinfo as new processstartinfo

startinfo.filename = "c:\winnt\system32\ping.exe"
startinfo.arguments = "127.0.0.1"
myproc.start(startinfo)

This works just fine, and does what I want, I just want to be able to make the window not visible..


Anyone??

Thanks,
exx
0
exx1976
Asked:
exx1976
  • 6
  • 4
1 Solution
 
Mikal613Commented:
Try Shell("Ping 127.0.0.1 > c:\REs.txt")
0
 
exx1976Author Commented:
I ended up figuring it out..  I just did

startinfo.filename = "c:\winnt\system32\ping.exe"
startinfo.arguments = "127.0.0.1"
startinfo.windowstyle = processwindowstyle.hidden
myproc.start

But I do have a question about binding to AD..  Still want 500 points?
0
 
exx1976Author Commented:
Oops..  That last line should have read

myproc.start(startinfo)

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Mikal613Commented:
Go for it whats the question?
0
 
exx1976Author Commented:
I am currently using LDAP to bind to active directory, however, the command process I am calling in the above code (TSCMD) requires a servername to bind to.  Every once in a while, the program will bind to the other DC, and then when I go to set the properties of the user with TSCMD, the account has not yet replicated to the specified server.  Is there a way to bind to a specific server in AD using LDAP so that I can always guarantee that the accounts will be created on the same server as TSCMD references?


0
 
Mikal613Commented:
I think well close this one and create a new question so people can learn from your question.
0
 
Mikal613Commented:
http://www.experts-exchange.com/Community_Support/

and just send this link and tell them to close it
0
 
Mikal613Commented:
is it windows 2000?
0
 
Mikal613Commented:
Why did you accept the question?
0
 
exx1976Author Commented:
It was easier to just give you the points.  Besides, I'm sure that the answer you provided would have worked just fine.

The AD/LDAP question is here:  http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21185012.html


Thanks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now