can the procedure in the program be hidden?

This is a discussion on can the procedure in the program be hidden? within the C++ Programming forums, part of the General Programming Boards category; is there any way to hidden the procedure performed by the program which is the system("") command? e.g. i have ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    can the procedure in the program be hidden?

    is there any way to hidden the procedure performed by the program which is the system("") command?

    e.g.
    i have a sentence :

    system("map delete m:");

    when i run the program, "map delete m:" will pop up in the dos prompt... is there ay way to hidden that?

    thank you for helping.

  2. #2
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002
    Posts
    282
    try clearing the screen immediately after that using system("CLS") or something like that

  3. #3
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    or change the font color to black?

  4. #4
    GA ichijoji's Avatar
    Join Date
    Nov 2002
    Posts
    179
    You could use the old DOS .bat stuff:

    system("echo off");
    system("cls");
    system(...);
    system("echo on");
    Illusion and reality become impartiality and confidence.

  5. #5
    verbose cat
    Join Date
    Jun 2003
    Posts
    209

    Re: can the procedure in the program be hidden?

    Originally posted by Jasonymk
    is there any way to hidden the procedure performed by the program which is the system("") command?

    e.g.
    i have a sentence :

    system("map delete m:");

    when i run the program, "map delete m:" will pop up in the dos prompt... is there ay way to hidden that?

    thank you for helping.
    or you could use "map delete m: > NUL" which will re-direct the output from the 'map' command to the file you specify (in this case NUL which will simply ignore it).

    I know this works in DOS and in a "dos box" in windows, I however don't know if it would work in the *nix environment as I have (sadly) never had the opportunity to really play around with.

    You can test it out by going to the command prompt and typing

    "dir"

    and then

    "dir > NUL"

    and then

    "dir > result.txt"

    The first will show you the directory.
    The second will show you nothing.
    The third will create a file called 'result.txt' and redirect the output from the dir into that text file.

    Hope this helps.

    -jEssYcAt

  6. #6
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    thanks!!!!

    thank you soo much!!!

  7. #7
    Registered User
    Join Date
    Jul 2003
    Posts
    8
    On a side note jEssYcAt:

    the same thing is achieved in *nix environment like this:
    Code:
    some_command > /dev/null
    where /dev/null is a special file which discards everything it recieves.
    (sort of like a black hole )

    --Placid

  8. #8
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    With regards to mapping a drive, this maybe another option for you to use:
    http://msdn.microsoft.com/library/de..._functions.asp
    Haven't used it myself, but APIs are usually a better way to do business with the OS than simply system()'ing a command to it.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  2. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 10:17 PM
  3. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 10:58 PM
  4. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21