@ echo off

::Check for permissions

IF " % PROCESSOR_ARCHITECTURE % " EQU "amd64" (

> nul 2 >& 1 " % SYSTEMROOT % \SysWOW64\cacls.exe" " % SYSTEMROOT % \SysWOW64\config\system"

) else (

> nul 2 >& 1 " % SYSTEMROOT % \system32\cacls.exe" " % SYSTEMROOT % \system32\config\system"

)

::If error flag set, we do not have admin.

if ' % errorlevel % ' NEQ '0' (

echo Requesting administrative privileges...

goto UACPrompt

) else ( goto gotAdmin

)

: UACPrompt

echo Set UAC = CreateObject ^( "Shell.Application" ^) > " % temp % \getadmin.vbs"

set params= % *

echo UAC.ShellExecute "cmd.exe", "/c "" % ~s0 "" % params:"="" % ", "", "runas", 1 >> " % temp % \getadmin.vbs"

" % temp % \getadmin.vbs"

del " % temp % \getadmin.vbs"

exit /B

: gotAdmin

pushd " % CD % "

cd /D " % ~dp0 "

: Main Menu

::LOGO

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo __ __ _ __ __

echo ^| \/ ^| ( _ ) ^| \/ ^|

echo ^| \ / ^| __ _ _ _ __ ^| \ / ^| ___ _ __ _ _

echo ^| ^| \/ ^| ^| / _` ^| ^| ^| ^| '_ \ ^| ^| \/ ^| ^| / _ \ ^| '_ \ ^| ^| ^| ^|

echo ^| ^| ^| ^| ^| ( _ ^| ^| ^| ^| ^| ^| ^| ^| ^| ^| ^| ^| ^| __/ ^| ^| ^| ^| ^| ^| _ ^| ^|

echo ^| _ ^| ^| _ ^| \__,_ ^| ^| _ ^| ^| _ ^| ^| _ ^| ^| _ ^| ^| _ ^| \___ ^| ^| _ ^| ^| _ ^| \__,_ ^|

echo .

::Displays Choices Options

echo Please choice an option.

echo 1 = Exit ?

echo 2 = Update user account password?

echo 3 = Add user account?

echo 4 = Delete user account?

echo 5 = Get info about a user account?

echo 6 = Fix password expires?

echo 7 = Disable/Enable user account?

echo 8 = Make NAS Shortcuts?

echo 9 = Student laptop disable MS acc, BG, Profile picture ^& Lockscreen?

echo a = Clean up Student account folders ^& Make bat file in public desktop?

::Choices

choice /C 123456789a > nul

if errorLevel 10 goto Cleanup

if errorLevel 9 goto Disable Student

if errorlevel 8 goto Make Shortcut

if errorLevel 7 goto On Off User Account

if errorlevel 6 goto Fix Password Expires

if errorlevel 5 goto Info for User Accounts

if errorlevel 4 goto Delete User Account

if errorlevel 3 goto Add User Account

if errorlevel 2 goto Update User Account Password

if errorlevel 1 goto Kill Session

: Kill Session

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Displays Choices Options

echo Are you sure you would like to exit .

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & exit

: Update User Account Password

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo You have chosen to update a user account password.

::Shows list of users

net user

::Input user name & new password also set password not to expire

echo Please enter the user account name.

SET /P useraccount0=

if [ % useraccount0 % ] EQU [] ( cls & goto Main Menu

) else ( goto Password0

)

: Password0

echo .

echo Please enter the user account password.

set /p useraccountpass0=

echo .

net user % useraccount0 % % useraccountpass0 % > nul

wmic useraccount where "Name=' % useraccount0 % '" set PasswordExpires=false > nul

echo Done.

echo .

::Displays Choices Options

echo Would you like to update another user account password?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & goto Update User Account Password

: Add User Account

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo You have chosen to add a user account.

echo .

::Input user name & password then makes that user account with password & set password not to expire

echo Please enter the user account name.

SET /P useraccount1=

if [ % useraccount1 % ] EQU [] ( cls & goto Main Menu

) else ( goto Password1

)

: Password1

echo .

echo Please enter the user account password.

SET /P useraccountpass1=

echo .

net user /add % useraccount1 % % useraccountpass1 % > nul

wmic useraccount where "Name=' % useraccount1 % '" set PasswordExpires=false > nul

echo Done.

echo .

::Displays Choices Options

echo Would you like to add this user account to the administrator group?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 echo . & goto AnotherAccount

if errorLevel 1 echo . & goto Administrator Group

: Administrator Group

net localgroup administrators % useraccount1 % /add > nul

echo Done.

echo .

: AnotherAccount

::Displays Choices Options

echo Would you like to add another user account?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & goto Add User Account

: Delete User Account

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo You have chosen to delete a user account.

::Shows list of users

net user

::Input user name of account then deletes user account & user folder

echo Please enter the user account name to delete.

SET /P useraccount2=

if [ % useraccount2 % ] EQU [] ( cls & goto Main Menu

) else ( goto Password2

)

: Password2

echo .

net user /delete % useraccount2 % > nul

echo Done.

echo .

::Displays Choices Options

echo Would you like to delete another user account?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & goto Delete User Account

: Fix Password Expires

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo You have chosen to fix password expiring.

::Shows list of users

net user

::Input user name of account to fix expiring password

echo Please enter the user account name of the account you want to fix with an expiring password.

SET /P useraccount3=

if [ % useraccount3 % ] EQU [] ( cls & goto Main Menu

) else ( goto Password3

)

: Password3

echo .

wmic useraccount where "Name=' % useraccount3 % '" set PasswordExpires=false > nul

echo Done.

echo .

::Displays Choices Options

echo Would you like to fix another user account with a expiring password?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & goto User Account Info

: Info for User Accounts

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo You have chosen to show info about a user account.

::Shows list of users

net user

::Input user name of the account to see info for

echo Please enter the user account name of the account you want to show info for .

SET /P useraccount4=

if [ % useraccount4 % ] EQU [] ( cls & goto Main Menu

) else ( goto Password4

)

: Password4

echo .

net user % useraccount4 %

echo Done.

echo .

::Displays Choices Options

echo Would you like to see info about another user account?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & goto Info for User Accounts

: On Off User Account

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo You have chosen to disable or enable a user accounts.

::Shows list of users

net user

::Input user name of the account to see info for

echo Please enter the user account name of the account you want to enable or disable.

SET /P useraccount5=

if [ % useraccount5 % ] EQU [] ( cls & goto Main Menu

) else ( goto EorD

)

: EorD

::Displays Choices Options

echo .

echo Would you like to disable or enable this user accounts?

echo .

echo 1 = Enable

echo 2 = Disable

::Choices

choice /C:12 > nul

if errorlevel 2 goto Disabled

if errorLevel 1 goto Enabled

: Disabled

echo .

net user % useraccount5 % /Active:no > nul

echo Done.

echo .

::Displays Choices Options

echo Would you like to disable or enable another user accounts?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & goto On Off User Account

: Enabled

echo .

net user % useraccount5 % /Active:yes > nul

echo Done.

echo .

::Displays Choices Options

echo Would you like to disable or enable another user accounts?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & goto On Off User Account

: Make Shortcut

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo Make NAS Shortcuts.

echo .

::Making shortcutes

set SCRIPT=" % TEMP % \ % RANDOM % - % RANDOM % - % RANDOM % - % RANDOM % .vbs"

echo Set oWS = WScript.CreateObject ( "WScript.Shell" ) >> % SCRIPT %

echo sLinkFile = "C:\Users\Public\Desktop\YUPI Group NAS.lnk" >> % SCRIPT %

echo Set oLink = oWS.CreateShortcut ( sLinkFile ) >> % SCRIPT %

echo oLink.TargetPath = "\\192.168.0.210" >> % SCRIPT %

echo oLink.Save >> % SCRIPT %

cscript /nologo % SCRIPT %

del % SCRIPT %

set SCRIPT=" % TEMP % \ % RANDOM % - % RANDOM % - % RANDOM % - % RANDOM % .vbs"

echo Set oWS = WScript.CreateObject ( "WScript.Shell" ) >> % SCRIPT %

echo sLinkFile = "C:\Users\Public\Desktop\Challenge NAS.lnk" >> % SCRIPT %

echo Set oLink = oWS.CreateShortcut ( sLinkFile ) >> % SCRIPT %

echo oLink.TargetPath = "\\192.168.0.200" >> % SCRIPT %

echo oLink.Save >> % SCRIPT %

cscript /nologo % SCRIPT %

del % SCRIPT %

echo Done.

echo Returning to Main Menu in 3 secs or press any key to reture now...

timeout 3 > nul

cls & Goto Main Menu

: Disable Student

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo Disable MS acc, BG, Profile picture ^& Lockscreen.

echo .

::Disabling regedit keys

echo Disabling linking MS account...

REG Add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System /v NoConnectedUser /t REG_DWORD /d 3 /f

echo .

echo Disabling lockscreen...

REG Add HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Personalization /v NoChangingLockScreen /t REG_DWORD /d 1 /f

echo .

echo Disabling wallpaper changing...

REG Add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop /v NoChangingWallPaper /t REG_DWORD /d 1 /f

echo .

echo Disabling profile picture changing...

REG Add HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\Settigs\AllowYouAccount /v value /t REG_DWORD /d 0 /f

echo .

echo Done.

::Displays Choices Options

echo You computer will need to restart. Do you wish to restart?

echo .

echo 1 = Yes

echo 2 = No

::Choices

choice /C:12 > nul

if errorlevel 2 cls & goto Main Menu

if errorLevel 1 cls & shutdown /r /t 1

: Cleanup

::LOGO

cls

echo : :: : :: : :: : :::::::: : ::::::: : :::::::: : ::

echo : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +: : +:

echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+

echo +#++:++#++: +#+ +:+ +#++:++#: +#+ +:+ +#++:++#: +#++:++#++:

echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+

echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#

echo ### ### ######## ### ### ######## ### ### ### ###

echo .

::Sub Title

echo Clean up Student account folders ^& Make bat file in public desktop.

echo .

::Making cleanup bat file in public desktop & Cleaning student folders

del /s/q "C:\users\Public\Desktop\Please run after using this PC.bat" > nul

set SCRIPT="C:\users\Public\Desktop\Please run after using this PC.bat"

echo cd c:\Users\Student > nul >> % SCRIPT %

echo rmdir /s/q Desktop > nul >> % SCRIPT %

echo mkdir Desktop > nul >> % SCRIPT %

echo rmdir /s/q Downloads > nul >> % SCRIPT %

echo mkdir Downloads > nul >> % SCRIPT %

echo rmdir /s/q Documents > nul >> % SCRIPT %

echo mkdir Documents > nul >> % SCRIPT %

echo rmdir /s/q Pictures > nul >> % SCRIPT %

echo mkdir Pictures > nul >> % SCRIPT %

echo rmdir /s/q Music > nul >> % SCRIPT %

echo mkdir Music > nul >> % SCRIPT %

echo rmdir /s/q Videos > nul >> % SCRIPT %

echo mkdir Videos > nul >> % SCRIPT %

echo echo Done >> % SCRIPT %

echo echo Exiting in 3 secs... >> % SCRIPT %

echo timeout 3 >> % SCRIPT %

echo exit >> % SCRIPT %

cscript /nologo % SCRIPT % > nul

::Done

echo Done.

echo Returning to Main Menu in 3 secs or press any key to reture now...

timeout 3 > nul