Professional Web Applications Themes

Hiding cmd promt window - ASP.NET Security

Hello All, I am puzzled over how to hide the cmd prompt window?? mycopy.exe copies a know set of files from one location to the other. Here I am struggling to hide / supress the cmd prompt window which stays until the process is exited. <code snippet> Process proc = new Process(); proc.StartInfo.FileName = "mycopy.exe"; proc.StartInfo.CreateNoWindow = true; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.UseShellExecute = false; proc.StartInfo.CreateNoWindow = true; proc.StartInfo.WindowStyle = ProcessWindowStyle.hidden; proc.Start(); proc.WaitForExit(); proc.Close(); </code snippet> Upon a few browses, I understood that, ProcessWindowStyle works well for the application invoked (for ex, notepad through a cmd prompt) but not on the ...

  1. #1

    Default Hiding cmd promt window

    Hello All,

    I am puzzled over how to hide the cmd prompt window??

    mycopy.exe copies a know set of files from one location to the other.
    Here I am struggling to hide / supress the cmd prompt window which stays
    until the process is exited.

    <code snippet>

    Process proc = new Process();
    proc.StartInfo.FileName = "mycopy.exe";
    proc.StartInfo.CreateNoWindow = true;
    proc.StartInfo.RedirectStandardOutput = true;
    proc.StartInfo.UseShellExecute = false;
    proc.StartInfo.CreateNoWindow = true;
    proc.StartInfo.WindowStyle = ProcessWindowStyle.hidden;
    proc.Start();
    proc.WaitForExit();
    proc.Close();

    </code snippet>

    Upon a few browses, I understood that, ProcessWindowStyle works well for
    the application invoked (for ex, notepad through a cmd prompt) but not
    on the cmd prompt itself.

    Can anyone please help me in how to overcome this?.
    Thanks in advance
    ../Shyam

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Shyam Prakash Guest

  2. #2

    Default Re: Hiding cmd promt window

    Why don't you turn mycopy.exe in .NET code so you can call it directly in
    your page and bypass the command prompt altogether?

    "Shyam Prakash" <otherthings> wrote in message
    news:%23Q%23qX$bCFHA.2884TK2MSFTNGP15.phx.gbl...
    > Hello All,
    >
    > I am puzzled over how to hide the cmd prompt window??
    >
    > mycopy.exe copies a know set of files from one location to the other.
    > Here I am struggling to hide / supress the cmd prompt window which stays
    > until the process is exited.
    >
    > <code snippet>
    >
    > Process proc = new Process();
    > proc.StartInfo.FileName = "mycopy.exe";
    > proc.StartInfo.CreateNoWindow = true;
    > proc.StartInfo.RedirectStandardOutput = true;
    > proc.StartInfo.UseShellExecute = false;
    > proc.StartInfo.CreateNoWindow = true;
    > proc.StartInfo.WindowStyle = ProcessWindowStyle.hidden;
    > proc.Start();
    > proc.WaitForExit();
    > proc.Close();
    >
    > </code snippet>
    >
    > Upon a few browses, I understood that, ProcessWindowStyle works well for
    > the application invoked (for ex, notepad through a cmd prompt) but not
    > on the cmd prompt itself.
    >
    > Can anyone please help me in how to overcome this?.
    > Thanks in advance
    > /Shyam
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!
    Ken Cox [Microsoft MVP] Guest

  3. #3

    Default Re: Hiding cmd promt window

    Hello Ken,

    That will do for my own code but in case mycopy.exe is a third party
    tool then how to handle that??

    Even in a simple case where I open a Notepad.exe, I get the cmd prompt
    window.

    Thanks
    ./Shyam



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Shyam Prakash Guest

Similar Threads

  1. PopUp window hiding
    By Mirza Asim in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 11th, 10:25 PM
  2. insert a frame or window into adobe acrobat or reader window
    By Mike_Blood@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 3
    Last Post: April 8th, 06:09 PM
  3. New Window Target doesn't open a new window inContribute but does in Firefox
    By toddtemple2 in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: January 8th, 08:36 PM
  4. Setting a popup window's base target to caller window?
    By saf_123 in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: July 6th, 11:01 AM
  5. Can't Print from Dos Promt! Access denied!
    By Camilo in forum Windows Setup, Administration & Security
    Replies: 1
    Last Post: July 9th, 05:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139