Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- cd /d %0\..
- if [%1]==[] start "BalloonChair" BalloonChair.bat /menu && exit /b
- SetLocal EnableDelayedExpansion
- set menucount=0
- call :MenuAdd Run "Run BalloonChair"
- call :MenuAdd PresentMode "Reboot to BalloonChair (Auto-start)"
- call :MenuAdd WindowsMode "Reboot to Windows"
- rem call :MenuAdd IniSettings "Edit Globe4D settings file"
- rem call :MenuAdd UserAccountControl "User Account Control Settings"
- rem call :MenuAdd Display "Display settings"
- rem call :MenuAdd Power "Power settings"
- rem call :MenuAdd AutoLogin "Auto Login Settings"
- rem call :MenuAdd Driver "Install driver"
- rem call :MenuAdd Quicktime "Install Quicktime"
- call :MenuAdd Command "Open Command shell"
- rem call :MenuAdd UpdateFirmware "Update Firmware"
- rem call :MenuAdd TestFirmware "Test Firmware"
- rem call :MenuAdd UpdateSoftware "Update Globe4D.exe"
- call :MenuAdd Explorer "Open Explorer"
- call :MenuAdd Github "Open Github software"
- call :MenuAdd Reboot "Reboot"
- rem call :MenuAdd Shutdown "Shutdown"
- rem call :MenuAdd ExitMenu "Exit Menu"
- if [%1]==[/run] goto Boot
- :Menu
- mode con: lines=15 cols=55
- title Globe4D - BalloonChair
- cls
- echo.
- echo Globe4D - BalloonChair
- echo Copyright (c) 2005-2016 www.globe4d.com
- echo.
- for /f "usebackq delims== tokens=1-2" %%i in (`set title`) do echo %%j
- echo.
- set /p input="> "
- set label=!label_%input%!
- if [%label%]==[] goto Menu
- goto %label%
- exit
- :MenuAdd
- set /a menucount+=1
- set myvar=%2
- set noquotes=!myvar:"=!
- set withzero=0!menucount!
- set withzero=!withzero:~-2!
- set withspace= !menucount!
- set withspace=!withspace:~-2!
- set title_%withzero%= %withspace%. %noquotes%
- set label_%menucount%=%1
- goto :eof
- :Github
- start %APPDATA%\..\Local\GitHub\GitHub.appref-ms
- goto Menu
- :PresentMode
- ::set shell="%~dp0Globe4D.bat /run"
- set shell=%~dp0BalloonChair.bat /run
- goto SetShell
- :WindowsMode
- set shell=explorer.exe
- goto SetShell
- :UserAccountControl
- UserAccountControlSettings.exe
- cls
- echo.
- echo The computer needs to be restarted after
- echo changing the User Account Control Settings.
- echo.
- choice /m " Do you want to reboot now?"
- if [%errorlevel%]==[1] shutdown /r /t 0
- goto Menu
- :Command
- cls
- start cmd
- goto Menu
- :Explorer
- start explorer .
- goto Menu
- :Boot
- rem start /MIN hangfix.bat
- rem timeout 5
- title Globe4D - BalloonChair
- mode con: lines=15 cols=55
- goto Run
- :Run
- cls
- start /wait /high BalloonChair.exe
- rem choice /t 2 /d y /m "Restart Globe4D-Driver?"
- rem if [%errorlevel%]==[1] goto Run
- goto Menu
- :IniSettings
- start data/Globe4D.ini
- goto Menu
- :Display
- start desk.cpl
- goto Menu
- :Power
- start powercfg.cpl
- goto Menu
- :Driver
- start drivers
- start mmc devmgmt.msc
- goto Menu
- :Quicktime
- start tools/QuickTimeInstaller.exe
- goto Menu
- :AutoLogin
- control.exe userpasswords2
- goto Menu
- :SetShell
- set key=HKLM\Software\Microsoft\Windows NT\Currentversion\Winlogon
- echo set UAC = CreateObject^("Shell.Application"^) > tmp.vbs
- echo UAC.ShellExecute "reg.exe", "ADD ""%key%"" /f /v Shell /t REG_SZ /d ""%shell%""", "", "runas", 0 >> tmp.vbs
- tmp.vbs
- del tmp.vbs
- goto reboot
- :::SetShell
- ::::reg add "HKLM\Software\Microsoft\Windows NT\Currentversion\Winlogon" /f /v Shell /t REG_SZ /d %shell% >nul 2>&1
- ::if [%errorlevel%]==[1] (
- :: cls
- :: echo.
- :: echo There was a problem changing the Windows Shell.
- :: echo Please first set 'User Account Control' to 'Never notify'
- :: echo.
- :: echo Press a key to open the settings window.
- :: pause > nul
- :: goto UserAccountControl
- ::) else (
- :: cls
- :: goto Reboot
- ::)
- :Reboot
- echo.
- echo Press a key to restart the computer.
- pause > nul
- shutdown /r /t 0
- goto Menu
- :Shutdown
- cls
- echo.
- echo Press a key to turn off the computer.
- pause > nul
- shutdown /s /t 0
- goto Menu
- :TestFirmware
- cls
- echo.
- ::tools\plink -serial COM4 -sercfg 115200,8,n,1,N
- ::pause
- ::goto Menu
- for /F "tokens=*" %%i in ('reg query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM') do set output=%%i
- set COMPORT=%output:~-4%
- set /p COMPORT=Press Enter to test firmware through %COMPORT%:
- echo.
- echo Connecting to %COMPORT%...
- MODE %COMPORT%:115200,N,8,1>NUL
- type %COMPORT%:
- echo.
- pause
- goto Menu
- :UpdateFirmware
- cls
- echo.
- for /F "tokens=*" %%i in ('reg query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM') do set output=%%i
- set COMPORT=%output:~-4%
- set /p COMPORT=Press Enter to upgrade firmware through %COMPORT%:
- echo.
- echo Connecting to %COMPORT%...
- mode %COMPORT%: DTR=on > NUL
- mode %COMPORT%: DTR=off > NUL
- cd firmware
- avrdude -c arduino -b57600 -p atmega328p -C avrdude.conf -P %COMPORT% -D -Uflash:w:firmware.hex:i
- cd ..
- if [%errorlevel%]==[1] echo There was a problem uploading the firmware.
- echo.
- pause
- goto Menu
- :UpdateSoftware
- cls
- echo.
- setlocal EnableDelayedExpansion
- set flag=0
- for %%i in (D,E,F,G,H,I,J,K,L) do (
- set file=%%i:\Globe4D.exe
- if exist !file! (
- echo Found: !file!
- echo.
- xcopy /-Y !file! .
- echo.
- set flag=1
- )
- set file=%%i:\Globe4D.bat
- if exist !file! (
- echo Found: !file!
- echo.
- xcopy /-Y !file! .
- echo.
- set flag=1
- )
- )
- if (flag==0) echo File or USB-drive not found.
- pause
- goto Menu
- exit
- :ExitMenu
- exit
Add Comment
Please, Sign In to add comment