wanna know how ure laptop can tell if ure a student or not? here look at htis
REM @ECHO OFF
REM Added by John Jennings 9:19 AM 5/12/2009 - To get update.cmd and configure.cmd to update correctly.
if /I "%1"=="1" goto StartConfigure
REM -------------------------------------------------------------------------------------
REM This wil update all of the local scripts and files
REM Keep this line at the BEGINNING of this file
rem start "Updating Local Files. Please wait ..........." /Max /WAIT cmd.exe /c "C:\windows\system32\IBMscripts\update.cmd"
robocopy "O:\Personal Laptop Config\C-Drive\windows\system32\IBMscripts" "C:\windows\system32\IBMscripts" update.cmd /w:1 /r:1 /e /NJH /NJS /NDL /XO
start "Updating Local Files. Please wait....." /MIN "C:\windows\system32\IBMscripts\update.cmd"
goto DONE
REM DO NOT CHANGE ANYTHING ABOVE THIS LINE!
:StartConfigure
TITLE Configuring Laptop ....
CALL :CHKSTUDENT
REM Added by Viktor 10:34 AM 5/7/2009 to make sure the desktop directory exists
if not exist "D:\Desktools" MD "D:\Desktools"
if not exist "H:\profile" MD "h:\profile"
if not exist "H:\profile\desktop" MD "h:\profile\desktop"
if not exist "H:\Favorites" MD "H:\Favorites"
if not exist "H:\Network File Utilities" MD "H:\Network File Utilities"
CALL :CLEANUP
CALL :NETDETECT
CALL :REFRESH
CALL :LanSchool
goto DONE
REM End of Control section
REM #####################################################################################
REM #####################################################################################
:CHKSTUDENT
IF EXIST "C:\RIGHTUPDATE.TXT" goto END
REM This section checks to see if this user is a student
ifmember "%USERDOMAIN%\%SchoolCode%students"
echo your errorlevel is %ERRORLEVEL%
Set strFlag=%ERRORLEVEL%
IF "%strFlag%"=="1" CSCRIPT //nologo "C:\WINDOWS\system32\IBMscripts\wallpaper.vbs" "C:\Program Files\IBMSchool\studentDT.bmp"
If "%strFlag%"=="1" GOTO CHNGRIGHTS
ifmember "%USERDOMAIN%\%SchoolCode%teachers"
echo your errorlevel is %ERRORLEVEL%
Set strFlag=%ERRORLEVEL%
IF "%strFlag%"=="1" CSCRIPT //nologo "C:\WINDOWS\system32\IBMscripts\wallpaper.vbs" "C:\Program Files\IBMSchool\teacherDT.bmp"
If "%strFlag%"=="1" GOTO CHNGRIGHTS
goto END
REM #####################################################################################
REM #####################################################################################
:CHNGRIGHTS
REM Adds current user to administrators group
net localgroup administrators %USERNAME% /ADD
REM removes the students from the local administrators group
net localgroup administrators Students /DELETE
REM removes the students from the local administrators group
net localgroup administrators Teachers /DELETE
ECHO COMPLETE > C:\RIGHTUPDATE.TXT
goto END
REM #####################################################################################
REM #####################################################################################
:NETDETECT
REM 10:53 AM 5/7/2009 - Added by Viktor to detect if you are connected to the network
REM --------------------------------------------------------------------
REM Testing if L: is being mapped to the network drive
net use L: > C:\Drivetest.txt
FIND /I "Local name" C:\Drivetest.txt
ECHO Errorlevel is "%ERRORLEVEL%"
IF "%ERRORLEVEL%" == "0" goto SCHOOLNET
goto NOSCHLNET
REM #####################################################################################
REM #####################################################################################
:CLEANUP
REM --------------------------------------------------------------------
REM Clean the current environment
CALL "C:\WINDOWS\system32\IBMscripts\CLEANENV.cmd"
cls
REM --------------------------------------------------------------------
goto END
REM #####################################################################################
REM #####################################################################################
:REFRESH
REM -------------------------------------------------------------------------------------
REM Make the changes effective immediately
REM %SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
cscript //nologo "C:\WINDOWS\system32\IBMscripts\desktop.vbs"
goto END
REM #####################################################################################
REM #####################################################################################
:SCHOOLNET
TITLE Configuring for School Network ....
REM added by John Jennings 11:15 AM 12/05/2009 - to remove the flag file so network will not be detected if offline.
del c:\drivetest.txt /Q
ECHO ON
REM Added by Viktor 11:15 AM 5/7/2009 - Map S: drive to network Home directory
Net use S: "%HOMESHARE%\%USERNAME%"
REM Create common desktop shortcuts
shortcut /F:"H:\Profile\Desktop\SchoolConnect Utilities.lnk" /T:"S:\profile\desktop" /A:C /I:"C:\WINDOWS\system32\SHELL32.dll,34" /D:"SchoolConnect Desktop for %USERNAME%" /R:3 /W:"S:\profile\desktop"shortcut /F:"H:\Profile\Desktop\SchoolConnect Utilities.lnk" /T:"S:\profile\desktop" /A:C /I:"C:\WINDOWS\system32\SHELL32.dll,34" /D:"SchoolConnect Desktop for %USERNAME%" /R:3 /W:"S:\profile\desktop"
cacls "H:\Profile\Desktop\SchoolConnect Utilities.lnk" /E /C /G everyone:F
shortcut /F:"H:\Profile\Desktop\Network File Utilities.lnk" /T:"H:\Network File Utilities" /A:C /I:"c:\WINDOWS\system32\SHELL32.dll,66" /D:"Utilities for Managing Laptop User's Data"
cacls "H:\Profile\Desktop\Network File Utilities.lnk" /E /C /G everyone:F
REM -------------------------------------------------------------------------------------
IF NOT EXIST "C:\WINDOWS\system32\IBMscripts\logs" MD "C:\WINDOWS\system32\IBMscripts\logs"
ECHO %USERNAME% connected successfully on %DATE% at %TIME% >> "C:\WINDOWS\system32\IBMscripts\logs\Connections.txt"
REM -------------------------------------------------------------------------------------
goto END
REM #####################################################################################
REM #####################################################################################
:NOSCHLNET
REM Create desktop shortcuts for home use
shortcut /F:"H:\Profile\Desktop\Desk Tools.lnk" /T:"D:\Desktools" /A:C /I:"C:\Program Files\IBMSchool\Desktls.ico" /D:"Offline Desktools Icon" /R:3 /W:"H:\profile\desktop"
cacls "H:\Profile\Desktop\Desk Tools.lnk" /E /C /G everyone:F
goto END
REM #####################################################################################
REM #####################################################################################
:LanSchool
ifmember "%USERDOMAIN%\%SchoolCode%students"
IF "%ERRORLEVEL%"=="0" Start "SwitchToTeacher" /Min "C:\program files\lanschool\switchtoteacher.exe"
goto END
REM #####################################################################################
:Done
EXIT
:END
TITLE Complete
Wednesday, September 9, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment