Advertisement
adamchilcott

byodTasks.cmd

Aug 12th, 2017
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 4.28 KB | None | 0 0
  1. @echo off
  2.  
  3. cls
  4.  
  5. setlocal
  6.  
  7. REM ########################
  8. REM # Automate Student Tasks
  9. REM ########################
  10.  
  11. :mainMenu
  12. echo.
  13. echo YOU MUST RUN THIS AS AN ADMINISTRATOR
  14. echo.
  15. echo #####################################
  16. echo # 1. Configure Student Wi-Fi
  17. echo # 2. Configure Printing
  18. echo # 3. Install MS Office For Students
  19. echo # 4. Drop Back To A Command Prompt
  20. echo #####################################
  21. echo.
  22.  
  23. set /p varChoice="Enter An Option: "
  24.  
  25. if %varChoice%==1 goto :studentWiFi
  26. if %varChoice%==2 goto :printerSetup
  27. if %varChoice%==3 goto :msofficeSetup
  28. if %varChoice%==4 goto :eof
  29.  
  30. REM ##############################################
  31. REM # Delete, Then Re-Add Avondale Student Profile
  32. REM ##############################################
  33.  
  34. :studentWiFi
  35. netsh wlan delete profile name="Avondale"
  36. netsh wlan add profile filename=%cd%\Wi-Fi-Avondale-Student.xml
  37. netsh interface set interface "Wi-Fi" disabled
  38. ping -n 6 127.0.0.1>nul
  39. netsh interface set interface "Wi-Fi" enabled
  40. goto :mainMenu
  41.  
  42. REM #######################################################
  43. REM # Connect To Print Server, Install PaperCut and Printer
  44. REM #######################################################
  45.  
  46. :printerSetup
  47. set exeLocation=\\lmpr0801.avondale.edu.au\PCClient\win
  48. set /p varUser="Please Enter Your UserName e.g. s14054524: "
  49. set /p driveLetter="Please Enter A Drive Letter e.g. Z: "
  50.  
  51. if exist %driveLetter% (
  52.     net use %driveLetter% /delete /y
  53.     net use %driveLetter% %exeLocation% /savecred
  54. ) else (
  55.     net use %driveLetter% %exeLocation% /savecred
  56. )
  57.  
  58. "%ProgramFiles(x86)%\PaperCut MF Client\unins000.exe" /verysilent
  59. del %USERPROFILE%\pc-auth.cookie
  60. del %USERPROFILE%\pc-client.properties
  61. "%driveLetter%\client-local-install.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
  62.  
  63. "%SystemRoot%\system32\rundll32.exe" printui.dll,PrintUIEntry /dn /n \\lmpr0801.avondale.edu.au\MyPrintQueue
  64. "%SystemRoot%\system32\rundll32.exe" printui.dll,PrintUIEntry /in /n \\lmpr0801.avondale.edu.au\MyPrintQueue
  65. "%SystemRoot%\system32\rundll32.exe" printui.dll,PrintUIEntry /y /n \\lmpr0801.avondale.edu.au\MyPrintQueue
  66.  
  67. net use %driveLetter% /delete /y
  68. "%ProgramFiles(x86)%\PaperCut MF Client\pc-client.exe" --user=%varUser% --neverrequestidentity=n
  69. goto :mainMenu
  70.  
  71. :msofficeSetup
  72. robocopy /mir /256 /r:6 /w:1 %cd%\packages.d\16.0.6741.2048 %temp%\16.0.6741.2048
  73. start /b /d %temp%\16.0.6741.2048 %temp%\16.0.6741.2048\Setup.exe
  74.  
  75. goto :mainMenu
  76.  
  77. endlocal
  78.  
  79. REM #############
  80. REM # START NOTES
  81. REM #############
  82.  
  83. REM # 2-clause license ("Simplified BSD License" or "FreeBSD License")
  84. REM #
  85. REM # Copyright © 2018, Adam Brian Chilcott
  86. REM # All rights reserved.
  87. REM #
  88. REM # Redistribution and use in source and binary forms, with or without
  89. REM # modification, are permitted provided that the following conditions are met:
  90. REM #
  91. REM # 1. Redistributions of source code must retain the above copyright notice, this
  92. REM # list of conditions and the following disclaimer.
  93. REM # 2. Redistributions in binary form must reproduce the above copyright notice,
  94. REM # this list of conditions and the following disclaimer in the documentation
  95. REM # and/or other materials provided with the distribution.
  96. REM #
  97. REM # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  98. REM # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  99. REM # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  100. REM # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  101. REM # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  102. REM # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  103. REM # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  104. REM # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  105. REM # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  106. REM # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  107. REM #
  108. REM # The views and conclusions contained in the software and documentation are those
  109. REM # of the authors and should not be interpreted as representing official policies,
  110. REM # either expressed or implied, of the FreeBSD Project.
  111.  
  112. REM ###########
  113. REM # END NOTES
  114. REM ###########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement