Solved

Hide spawned process window?

Posted on 2004-10-27
250 Views
Last Modified: 2012-08-14
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
Question by:exx1976
    10 Comments
     
    LVL 48

    Expert Comment

    by:Mikal613
    Try Shell("Ping 127.0.0.1 > c:\REs.txt")
    0
     
    LVL 18

    Author Comment

    by:exx1976
    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
     
    LVL 18

    Author Comment

    by:exx1976
    Oops..  That last line should have read

    myproc.start(startinfo)

    0
     
    LVL 48

    Accepted Solution

    by:
    Go for it whats the question?
    0
     
    LVL 18

    Author Comment

    by:exx1976
    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
     
    LVL 48

    Expert Comment

    by:Mikal613
    I think well close this one and create a new question so people can learn from your question.
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    http://www.experts-exchange.com/Community_Support/

    and just send this link and tell them to close it
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    is it windows 2000?
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    Why did you accept the question?
    0
     
    LVL 18

    Author Comment

    by:exx1976
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    877 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

    13 Experts available now in Live!

    Get 1:1 Help Now