Results 1 to 4 of 4

Thread: how do I hide a output of a net use /delete

  1. #1
    AdminKen Guest

    how do I hide a output of a net use /delete

    I have a login script that deletes drive mappings. If the drives are do not
    exist I see a error message. How do I hide the messages?

    I have tried piping output to nul or a file but I still see the error
    message. What am I missing

    c:\net use i: /delete>NUL

    Example
    C:\net use i: /delete
    The network connection could not be found.
    More help is available by typing NET HELPMSG 2250.

    or
    C:\net use i: /delete>NUL
    The network connection could not be found.
    More help is available by typing NET HELPMSG 2250.



  2. #2
    Marty List Guest

    Re: how do I hide a output of a net use /delete

    AdminKen wrote:
    > I have a login script that deletes drive mappings. If the drives are do not
    > exist I see a error message. How do I hide the messages?
    >
    > I have tried piping output to nul or a file but I still see the error
    > message. What am I missing
    >
    > c:\net use i: /delete>NUL
    >
    > Example
    > C:\net use i: /delete
    > The network connection could not be found.
    > More help is available by typing NET HELPMSG 2250.
    >
    > or
    > C:\net use i: /delete>NUL
    > The network connection could not be found.
    > More help is available by typing NET HELPMSG 2250.
    >



    The short answer is use "2>NUL", like this:
    C:\>net.exe use i: /delete >NUL 2>NUL


    Most programs send their output to the stdout stream, which is
    represented by handle 1, or assumed if not present. So what you were
    doing is the same as this:
    C:\>net.exe use i: /delete 1>NUL


    Some programs separate their output, they send informational messages to
    stdout, and errors to stderr, represented by handle 2.

    You could also stderr (handle 2) to the same place as stdout (handle 1),
    like this:
    C:\>net.exe use i: /delete 1>NUL 2>&1


    For more information click Start -> Help and Support, and search for
    "using command redirection operators"


  3. #3
    J Ford Guest

    RE: how do I hide a output of a net use /delete

    Try this:

    net use i: /delete 2>NUL >NUL

    that should redirect both stdout & stderr

    ~Jeremy

    "AdminKen" wrote:

    > I have a login script that deletes drive mappings. If the drives are do not
    > exist I see a error message. How do I hide the messages?
    >
    > I have tried piping output to nul or a file but I still see the error
    > message. What am I missing
    >
    > c:\net use i: /delete>NUL
    >
    > Example
    > C:\net use i: /delete
    > The network connection could not be found.
    > More help is available by typing NET HELPMSG 2250.
    >
    > or
    > C:\net use i: /delete>NUL
    > The network connection could not be found.
    > More help is available by typing NET HELPMSG 2250.
    >
    >
    >


  4. #4
    AdminKen Guest

    Re: how do I hide a output of a net use /delete

    that worked
    thanks

    "J Ford" <JFord@discussions.microsoft.com> wrote in message
    news:4FF4DBB1-B3C6-438E-910E-1FD411E977B0@microsoft.com...
    > Try this:
    >
    > net use i: /delete 2>NUL >NUL
    >
    > that should redirect both stdout & stderr
    >
    > ~Jeremy
    >
    > "AdminKen" wrote:
    >
    >> I have a login script that deletes drive mappings. If the drives are do
    >> not
    >> exist I see a error message. How do I hide the messages?
    >>
    >> I have tried piping output to nul or a file but I still see the error
    >> message. What am I missing
    >>
    >> c:\net use i: /delete>NUL
    >>
    >> Example
    >> C:\net use i: /delete
    >> The network connection could not be found.
    >> More help is available by typing NET HELPMSG 2250.
    >>
    >> or
    >> C:\net use i: /delete>NUL
    >> The network connection could not be found.
    >> More help is available by typing NET HELPMSG 2250.
    >>
    >>
    >>




Similar Threads

  1. Replies: 5
    Last Post: 06-05-2012, 08:19 AM
  2. Replies: 6
    Last Post: 27-05-2011, 10:20 AM
  3. Tips to hide the delete option of Recycle bin
    By Brendan18 in forum Tips & Tweaks
    Replies: 1
    Last Post: 27-05-2011, 06:14 AM
  4. Can I hide or delete the Q drive?
    By Kaustubh m in forum Windows Software
    Replies: 6
    Last Post: 30-07-2010, 09:25 AM
  5. Auto-Hide toolbar won't hide?
    By Geoff from LA in forum Vista Help
    Replies: 8
    Last Post: 18-10-2009, 06:52 AM

Tags for this Thread

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
  •  
Page generated in 1,713,531,011.11557 seconds with 17 queries