CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2002
    Location
    India
    Posts
    54

    how to hide command prompt

    hi all,
    iam sending a copy command to command prompt with system () api.. but command prompt is poping up.

    I want to hide the command prompt.

    is there any other way to do it.

    thanx in advance
    * * * * * * * Out of all the things I've lost, I miss my mind the most * * * * * * * * .

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Take a look at the following FAQ...

  3. #3
    Join Date
    Jun 2002
    Location
    India
    Posts
    54

    is this correct ?

    That was great.

    Is this correct ?

    iam using copy c:\test.txt d:\test2.txt
    doing this with system()

    this pops up the command prompt.
    =======
    the equivalent of this in your FAQ is

    ShellExecute(0,"open","c:\\windows\\cmd.exe", "c:\test.txt d:\test2.txt", 0,SW_HIDE);

    Will this hide the command prompt...


    Manibee
    * * * * * * * Out of all the things I've lost, I miss my mind the most * * * * * * * * .

  4. #4
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Why not use the Windows CopyFile API - much simpler.

  5. #5
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: is this correct ?

    Originally posted by manibee
    Will this hide the command prompt...
    No...since you are explicitly creating one by starting 'cmd.exe'.

    Nevertheless, I missed the 'copy operation' part in the original message...there exists of course better functions to use...e.g. 'CopyFile()'...

    Why do you want to create a new process for that?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured