Results 1 to 9 of 9

Thread: Not Viewing Net Send "Result Message"

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Location
    Sweden, Skövde
    Posts
    14

    Not Viewing Net Send "Result Message"

    I was wondering how I write code that takes away the message you recieve in DOS when for example writing "net send NiVEN hello".. you get a response that states "The Message was sent to NiVEN".. how do I do to make the program to hide that message?

    is it possible?
    // fade][NiVEN
    fade@quakenet

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    command > nul:
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Location
    Sweden, Skövde
    Posts
    14
    where do I place that code line? This is the code which i'm using. where do I place the code you send me?



    sprintf(wholeString,"net send %s %s"),user,message;
    system(wholeString);
    // fade][NiVEN
    fade@quakenet

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    sprintf(wholeString,"net send %s %s > nul:"),user,message;

    nul: is a special redirect target in DOS, the same as /dev/nul in UNIX.

    Note: this only redirects the standard output. stderr will still be the console, this means error messages will still be written to the DOS window.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Location
    Sweden, Skövde
    Posts
    14
    i doesnt work. It messes up something concerning the user name. Get an error message about net send not being able to send the message to that alias. and it worked perfectly before adding your code. do you see anything wrong in my code that I should correct?


    Code:
    #include <iostream.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <cstdlib>
    #include <ctime>
    
    int main()
    {
    
    
    	char user[20];
    	char message[20];
    	int loops;
    	char wholeString[250];
    
    
    	
    
    	cout << "Send To: ";
    	cin >> user;
    	cout << "Message (max 20 symbols): ";
    	cin >> message;
    	cout << "Send how many times: ";
    	cin >> loops;
    
    
    for (int i = 0;i < loops;i++)
    	
    {
    
    
    //		Code before change
    //		sprintf(wholeString,"net send %s %s",user,message);
    
    		sprintf(wholeString,"net send %s %s > nul:"),user,message;
    		system(wholeString);
    
    }
    
    
    
    
    	cout << "\n";
    	return 0;
    
    }
    // fade][NiVEN
    fade@quakenet

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    That's strange, it shouldn't happen...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Location
    Sweden, Skövde
    Posts
    14
    Have you tested the code i posted?
    // fade][NiVEN
    fade@quakenet

  8. #8

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Location
    Sweden, Skövde
    Posts
    14
    i fixed the problem.. you had out the ")" in the wrong place in the code =). but thanx for your help
    // fade][NiVEN
    fade@quakenet

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    oops, yeah
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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