Guest User

Untitled

a guest
May 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. @echo off
  2. cd /d %0\..
  3.  
  4. if [%1]==[] start "BalloonChair" BalloonChair.bat /menu && exit /b
  5.  
  6. SetLocal EnableDelayedExpansion
  7. set menucount=0
  8. call :MenuAdd Run "Run BalloonChair"
  9. call :MenuAdd PresentMode "Reboot to BalloonChair (Auto-start)"
  10. call :MenuAdd WindowsMode "Reboot to Windows"
  11. rem call :MenuAdd IniSettings "Edit Globe4D settings file"
  12. rem call :MenuAdd UserAccountControl "User Account Control Settings"
  13. rem call :MenuAdd Display "Display settings"
  14. rem call :MenuAdd Power "Power settings"
  15. rem call :MenuAdd AutoLogin "Auto Login Settings"
  16. rem call :MenuAdd Driver "Install driver"
  17. rem call :MenuAdd Quicktime "Install Quicktime"
  18. call :MenuAdd Command "Open Command shell"
  19. rem call :MenuAdd UpdateFirmware "Update Firmware"
  20. rem call :MenuAdd TestFirmware "Test Firmware"
  21. rem call :MenuAdd UpdateSoftware "Update Globe4D.exe"
  22. call :MenuAdd Explorer "Open Explorer"
  23. call :MenuAdd Github "Open Github software"
  24. call :MenuAdd Reboot "Reboot"
  25. rem call :MenuAdd Shutdown "Shutdown"
  26. rem call :MenuAdd ExitMenu "Exit Menu"
  27.  
  28. if [%1]==[/run] goto Boot
  29.  
  30. :Menu
  31. mode con: lines=15 cols=55
  32. title Globe4D - BalloonChair
  33. cls
  34. echo.
  35. echo Globe4D - BalloonChair
  36. echo Copyright (c) 2005-2016 www.globe4d.com
  37. echo.
  38. for /f "usebackq delims== tokens=1-2" %%i in (`set title`) do echo %%j
  39. echo.
  40.  
  41. set /p input="> "
  42. set label=!label_%input%!
  43. if [%label%]==[] goto Menu
  44. goto %label%
  45.  
  46. exit
  47.  
  48. :MenuAdd
  49. set /a menucount+=1
  50. set myvar=%2
  51. set noquotes=!myvar:"=!
  52. set withzero=0!menucount!
  53. set withzero=!withzero:~-2!
  54. set withspace= !menucount!
  55. set withspace=!withspace:~-2!
  56. set title_%withzero%= %withspace%. %noquotes%
  57. set label_%menucount%=%1
  58. goto :eof
  59.  
  60. :Github
  61. start %APPDATA%\..\Local\GitHub\GitHub.appref-ms
  62. goto Menu
  63.  
  64. :PresentMode
  65. ::set shell="%~dp0Globe4D.bat /run"
  66. set shell=%~dp0BalloonChair.bat /run
  67. goto SetShell
  68.  
  69. :WindowsMode
  70. set shell=explorer.exe
  71. goto SetShell
  72.  
  73. :UserAccountControl
  74. UserAccountControlSettings.exe
  75. cls
  76. echo.
  77. echo The computer needs to be restarted after
  78. echo changing the User Account Control Settings.
  79. echo.
  80. choice /m " Do you want to reboot now?"
  81. if [%errorlevel%]==[1] shutdown /r /t 0
  82. goto Menu
  83.  
  84. :Command
  85. cls
  86. start cmd
  87. goto Menu
  88.  
  89. :Explorer
  90. start explorer .
  91. goto Menu
  92.  
  93. :Boot
  94. rem start /MIN hangfix.bat
  95. rem timeout 5
  96. title Globe4D - BalloonChair
  97. mode con: lines=15 cols=55
  98. goto Run
  99.  
  100. :Run
  101. cls
  102. start /wait /high BalloonChair.exe
  103. rem choice /t 2 /d y /m "Restart Globe4D-Driver?"
  104. rem if [%errorlevel%]==[1] goto Run
  105. goto Menu
  106.  
  107. :IniSettings
  108. start data/Globe4D.ini
  109. goto Menu
  110.  
  111. :Display
  112. start desk.cpl
  113. goto Menu
  114.  
  115. :Power
  116. start powercfg.cpl
  117. goto Menu
  118.  
  119. :Driver
  120. start drivers
  121. start mmc devmgmt.msc
  122. goto Menu
  123.  
  124. :Quicktime
  125. start tools/QuickTimeInstaller.exe
  126. goto Menu
  127.  
  128. :AutoLogin
  129. control.exe userpasswords2
  130. goto Menu
  131.  
  132. :SetShell
  133. set key=HKLM\Software\Microsoft\Windows NT\Currentversion\Winlogon
  134. echo set UAC = CreateObject^("Shell.Application"^) > tmp.vbs
  135. echo UAC.ShellExecute "reg.exe", "ADD ""%key%"" /f /v Shell /t REG_SZ /d ""%shell%""", "", "runas", 0 >> tmp.vbs
  136. tmp.vbs
  137. del tmp.vbs
  138. goto reboot
  139.  
  140. :::SetShell
  141. ::::reg add "HKLM\Software\Microsoft\Windows NT\Currentversion\Winlogon" /f /v Shell /t REG_SZ /d %shell% >nul 2>&1
  142. ::if [%errorlevel%]==[1] (
  143. :: cls
  144. :: echo.
  145. :: echo There was a problem changing the Windows Shell.
  146. :: echo Please first set 'User Account Control' to 'Never notify'
  147. :: echo.
  148. :: echo Press a key to open the settings window.
  149. :: pause > nul
  150. :: goto UserAccountControl
  151. ::) else (
  152. :: cls
  153. :: goto Reboot
  154. ::)
  155.  
  156. :Reboot
  157. echo.
  158. echo Press a key to restart the computer.
  159. pause > nul
  160. shutdown /r /t 0
  161. goto Menu
  162.  
  163. :Shutdown
  164. cls
  165. echo.
  166. echo Press a key to turn off the computer.
  167. pause > nul
  168. shutdown /s /t 0
  169. goto Menu
  170.  
  171. :TestFirmware
  172. cls
  173. echo.
  174. ::tools\plink -serial COM4 -sercfg 115200,8,n,1,N
  175. ::pause
  176. ::goto Menu
  177. for /F "tokens=*" %%i in ('reg query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM') do set output=%%i
  178. set COMPORT=%output:~-4%
  179. set /p COMPORT=Press Enter to test firmware through %COMPORT%:
  180. echo.
  181. echo Connecting to %COMPORT%...
  182. MODE %COMPORT%:115200,N,8,1>NUL
  183. type %COMPORT%:
  184. echo.
  185. pause
  186. goto Menu
  187.  
  188. :UpdateFirmware
  189. cls
  190. echo.
  191. for /F "tokens=*" %%i in ('reg query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM') do set output=%%i
  192. set COMPORT=%output:~-4%
  193. set /p COMPORT=Press Enter to upgrade firmware through %COMPORT%:
  194. echo.
  195. echo Connecting to %COMPORT%...
  196. mode %COMPORT%: DTR=on > NUL
  197. mode %COMPORT%: DTR=off > NUL
  198. cd firmware
  199. avrdude -c arduino -b57600 -p atmega328p -C avrdude.conf -P %COMPORT% -D -Uflash:w:firmware.hex:i
  200. cd ..
  201. if [%errorlevel%]==[1] echo There was a problem uploading the firmware.
  202. echo.
  203. pause
  204. goto Menu
  205.  
  206. :UpdateSoftware
  207. cls
  208. echo.
  209. setlocal EnableDelayedExpansion
  210. set flag=0
  211. for %%i in (D,E,F,G,H,I,J,K,L) do (
  212. set file=%%i:\Globe4D.exe
  213. if exist !file! (
  214. echo Found: !file!
  215. echo.
  216. xcopy /-Y !file! .
  217. echo.
  218. set flag=1
  219. )
  220. set file=%%i:\Globe4D.bat
  221. if exist !file! (
  222. echo Found: !file!
  223. echo.
  224. xcopy /-Y !file! .
  225. echo.
  226. set flag=1
  227. )
  228. )
  229. if (flag==0) echo File or USB-drive not found.
  230. pause
  231. goto Menu
  232. exit
  233.  
  234. :ExitMenu
  235. exit
Add Comment
Please, Sign In to add comment