Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping Display of Logon script?

Status
Not open for further replies.

Ajb2528

Technical User
Feb 22, 2002
270
GB
Is there any way of stopping the display of a logon script?

I have tried @ECHO OFF , @@ECHO OFF and just ECHO OFF on the first line of the logon script but to no avail.

What I would really like is for the logon script to run but with the DOS box preferably not showing at all or at least minimized. Does anybody know of a way to do this??

Regards,

Alan
 
Right-click the .batfile.
Under the Program tab find the dropdown menu next to "Run:"
Select minimized.
 
Also, if you've put a command in your batch file, such as

net use z: \\servername\sharename$

and you don't want anyone to see it, you can add > nul to the end e.g.

net use z: \\servername\sharename$ > nul

When it comes to that part of the logon script, it'll look like nothing has happened, however it will have mapped your drive.

The only bad thing about doing this is that it also supresses any error messages which might occur from that command e.g. if the server you're trying to map to is unavailable.

Regards
 
Right-click the .batfile.
Under the Program tab find the dropdown menu next to "Run:"
Select minimized.

-----Just saw that I forgot to say to add an Exit command to the .batfile
 
thatrenowned,

Thanks for the information!!

Can I append the > nul statement to each line within batch file?

ie the batch file is :

ECHO OFF
erase c:\windows\*.pwl
:: Check Windows version
IF %OS% == "Windows_NT" GOTO WNT

%0\..\winset OS=Windows_95
%0\..\winset USERDOMAIN=QCG
if not exist %windir%\net.pif copy %0\..\net.pif %windir%\net.pif
if not exist %windir%\wscript.exe start /wait %0\..\scr56en.exe /q
cscript.exe %0\..\RemoveInet.vbs //B //NOLOGO
cscript.exe %0\..\ZapWin9xPwd.vbs //B //NOLOGO

net use * /delete /yes
net use K: \\server2\Admin2
net use L: \\server2\Database
GOTO end

:WNT
if not exist %windir%\system32\wscript.exe /wait %0\..\scripten.exe /q
cscript.exe %0\..\RemoveInet.vbs //B //NOLOGO

net use * /delete /yes
net use K: \\server2\Admin2 /persistent:no
net use L: \\server2\Database /persistent:no
:end

As this is a logon script I cannot select the 'run minimized' option.

Also is there a way of stopping the user from interrupting the logon script?

Regards,

Alan
 
First line, use @ECHO OFF instead of just ECHO OFF, then add CLS, e.g.

@ECHO OFF
CLS


You should be able to add > nul to everything else except labels :)WNT for example) and GOTOs.

As for stopping the user from closing down the logon script, I haven't found a solution yet. However, I've started adding the following to my logon script and its helping a bit:

TITLE ** DO NOT CLOSE DOWN THIS BOX !! **

and as the command suggests, it makes the logon script's title whatever you type in.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top