Hide DOS Window

I have the following script that runs fine, however when it runs it opens up a black DOS window.  Is there any way that I can hide this DOS window?
here is the script

 Process.Start("C:\Program Files\SyncToy 2.0\SyncToyCmd.exe", "-R")
LVL 1
H-SCAsked:
Who is Participating?
 
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
Hi H-SC,

Try this way:
        Dim p As New ProcessStartInfo
        p.WindowStyle = ProcessWindowStyle.Hidden
        p.FileName = "C:\Program Files\SyncToy 2.0\SyncToyCmd.exe"
        p.Arguments = "-R"
        Process.Start(p)

Open in new window

0
 
H-SCAuthor Commented:
jpaulino,
never thought of doing it that way.  I was trying to handle it via a dos switch command.  Your suggestion is even better.  

perfect as always!!
many thanks
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Glad I could help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.