Computer Hope

Microsoft => Microsoft DOS => Topic started by: veasnayim on July 24, 2014, 02:05:41 PM

Title: How to hide command line when run bat
Post by: veasnayim 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
Title: Re: How to hide command line when run bat
Post by: Geek-9pm 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.  :)

Title: Re: How to hide command line when run bat
Post by: veasnayim on July 25, 2014, 07:25:56 AM
Thanks you so much Dear for your explaining!!
Best Regards,
Title: Re: How to hide command line when run bat
Post by: foxidrive 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"
Title: Re: How to hide command line when run bat
Post by: veasnayim 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,