Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to hide command line when run bat  (Read 3198 times)

0 Members and 1 Guest are viewing this topic.

veasnayim

    Topic Starter


    Greenhorn

    • Experience: Beginner
    • OS: Windows 7
    How to hide command line when run bat
    « on: July 24, 2014, 02:05:41 PM »
    Hello All,
    I wrote a command line to delete all mapped Network Drive..
     here is my code:
    @echo off
    NET USE * /DELETE

    When i run it, it ask that,
    You have these remote connections:

        P:              \\servername\acb
        T:              \\servername\cde
    Continuing will cancel the connections.

    Do you want to continue this operation? (Y/N) [N]:

    What my meaning, I don't want it show The Drive or Server path:
    I just want it to show only All drive current mapped on computer and Ask to Proceed Y or No?
    Can you help me?
    THanks you

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: How to hide command line when run bat
    « Reply #1 on: July 24, 2014, 03:16:43 PM »
    This has been considered many times b before. Many, Many times both here and other places. It ends up somebody asking; Why?  Batch files are  not meant to be hidden jobs. When a program needs to get out of the user's face, it can minimize to the teak bar.

    Here is a link to the topic in CH archives.
    http://www.computerhope.com/issues/ch000009.htm
    How to hide a file in MS-DOS and Windows command line
    Please read it over and come back and ask questions.  :)


    veasnayim

      Topic Starter


      Greenhorn

      • Experience: Beginner
      • OS: Windows 7
      Re: How to hide command line when run bat
      « Reply #2 on: July 25, 2014, 07:25:56 AM »
      Thanks you so much Dear for your explaining!!
      Best Regards,

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: How to hide command line when run bat
      « Reply #3 on: July 25, 2014, 07:41:05 AM »
      Code: [Select]
      @echo off
      NET USE * /DELETE
      When i run it, it ask that,
      Quote
      You have these remote connections:

          P:              \\servername\acb
          T:              \\servername\cde
      Continuing will cancel the connections.

      Do you want to continue this operation? (Y/N) [N]:
      What my meaning, I don't want it show The Drive or Server path:
      I just want it to show only All drive current mapped on computer and Ask to Proceed Y or No?


      Does this do what you want?

      Code: [Select]
      @echo off
      echo Do you want to continue this operation? (Y/N) [N]:
      NET USE * /DELETE |find "operation"

      veasnayim

        Topic Starter


        Greenhorn

        • Experience: Beginner
        • OS: Windows 7
        Re: How to hide command line when run bat
        « Reply #4 on: July 25, 2014, 09:17:48 AM »
        Hello Mentor:
        This is work very great and i reach my preferred.
        Thanks so much for all that spent time to take care me.
        Best regards,