Batch File Logon Script



I am having trouble accomplishing the following:
I want the following Logon Script to execute and test for the logon
If it is the Administrator I want the script to end and not map drive.
If it is another user than I want the script to continue. Can someone
please look at this and tell me what I am doing wrong?

Thank you

@echo off

REM Welcome Screen
echo *********************************************************************
echo * Please wait as the %username% is authenticated.
echo * You are accessing the network from %COMPUTERNAME%
echo * And you are running the %OS% os.
echo * Hello %USERNAME%, welcome to the network!
echo *********************************************************************

REM Set Network Time
net time \\abc /set /yes

REM Disconnect Existing Network Drive Connections
net use * /delete /yes

REM Test For Administrator
IF "%USERNAME%" == "Administrator" GOTO END
IF "%USERNAME%" == "" GOTO Drives

REM Connect Network Drives
net use /persistent:yes

net use M: \\abc\APPS
net use N: \\abc\Pub
net use x: \\abc\USERS\%UESERNAME%




Guilmot Mike

"spikestik" <[email protected]> schreef in bericht

| REM Test For Administrator
| IF "%USERNAME%" == "Administrator" GOTO END

Aren't you supposed to rename him ? ;-)


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question