Batch File Logon Script

  • Thread starter Thread starter spikestik
  • Start date Start date
S

spikestik

I am having trouble accomplishing the following:
I want the following Logon Script to execute and test for the logon
user.
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

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

:END
 
Back
Top