Discussion Locked

hiding net use command in login script

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm trying to write a login script and stop the statements from showing up on the screen
@net use h: /delete (does not work)
@net use h: \\home\local (works fine)

any suggestions out there ?

6 replies

by james.pounds

piping the commands to the "nul" operator will definitely work:
ie. "@net use h: /delete > nul"

Using the directive to turn off echoing to the console will also work. Use the command "echo off" on a line to prevent further commands being echoed to the active console and use the "echo on" command to turn echo back on. It would look like this in your logon script:

echo off
@net use h: /delete
@net use h: \\home\local
echo on

by james.pounds

BTW
If you want to suppress the display of the echo off and on commands you can pipe those to the nul operator like this:

echo off > nul
rem YOUR CODE HERE WILL NOT APPEAR
echo on > nul

This discussion is closed to new replies.