@echo off
set "topp=ÍÍ"
set "botp=ÍÍ"
set "globalversion=1.0"
if not exist temp_os\timer.cmd (
@echo.@echo off>temp_os\timer.cmd
@echo.bin_os\bg.exe sleep 32>>temp_os\timer.cmd
@echo.taskkill /F /IM bg.exe>>temp_os\timer.cmd
@echo.exit>>temp_os\timer.cmd
)
if not exist temp_os\hidewin.vbs @echo.CreateObject(^"Wscript.Shell^").Run ^"^"^"^" ^& WScript.Arguments(0) ^& ^"^"^"^", 0, False>temp_os\hidewin.vbs
setlocal EnableDelayedExpansion EnableExtensions
if "%1"=="-getinfo" goto appinfo
if exist "config_user\%user%_im.cmd" call "config_user\%user%_im.cmd"
if exist log_os\LogOS_is_running goto startscr
goto error
:error
Echo.
Echo This application can only be run inside Log OS.
Echo.
pause
exit
:appinfo
echo %2. Interface manager (version !globalversion!)
echo.   Description: Graphical desktop environment for Log OS
exit /b
:startscr
title Welcome %user% to Interface Manager
call :background !rndcolor:~1!!rndcolor:~0,1! !topp! !botp!
:finstartscr
bg locate 2 0
bg print !rndcolor:~1!!rndcolor:~0,1! "!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!"
bg locate 3 0
bg print !rndcolor:~1!!rndcolor:~0,1! "!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!"
bg locate 4 0
bg print !rndcolor:~1!!rndcolor:~0,1! "!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!!topp!"
bg locate 5 0
bg print !rndcolor:~1!!rndcolor:~0,1! "!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!!botp!"
bg locate 1 1
bg print 1f " Apps "
bg locate 1 8
bg print 2f " Settings "
bg locate 1 19
bg print 3f " Session "
bg locate 1 29
bg print 4f " Profile "
bg locate 1 39
bg print 5f " Command "
bg locate 1 49
bg print 0f " About "
bg locate 4 1
bg print !rndcolor! "!user!"
bg locate 5 1
bg print !rndcolor! "!description!"
bg locate 7 1
bg print !rndcolor! "Your lucky number is : %randomm%"
bg locate 8 1
bg print !rndcolor! "LogOS was started at : %ld:\=/%"
set /a timeout=0
:input
bg locate 9 1
bg print !rndcolor! "Current date : %date%"
set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
bg locate 10 1
bg print !rndcolor! "Current time : %hour%:%min%:%secs%"
if exist "config_user\%user%_im.cmd" call "config_user\%user%_im.cmd"
start Wscript temp_os\hidewin.vbs temp_os\timer.cmd
for /f "tokens=1- 3" %%a in ('bg mouse') do set y=%%a&set x=%%b
set /a timeout+=128
if %timeout% GTR 30000 goto runsaver
for /l %%a in (1 1 6) do (
if "!x!;!y!"=="%%a;1" goto appmenu
)
for /l %%a in (8 1 17) do (
if "!x!;!y!"=="%%a;1" goto setting
)
for /l %%a in (19 1 27) do (
if "!x!;!y!"=="%%a;1" goto sessionmenu
)
for /l %%a in (29 1 37) do (
if "!x!;!y!"=="%%a;1" goto viewprofile
)
for /l %%a in (39 1 47) do (
if "!x!;!y!"=="%%a;1" goto launchcmd
)
for /l %%a in (49 1 56) do (
if "!x!;!y!"=="%%a;1" goto showabout
)
goto input

:showabout
call :background !rndcolor:~1!!rndcolor:~0,1! !topp! !botp!
bg locate 1 1
bg print 1f " Apps "
bg locate 1 8
bg print 2f " Settings "
bg locate 1 19
bg print 3f " Session "
bg locate 1 29
bg print 4f " Profile "
bg locate 1 39
bg print 5f " Command "
bg locate 1 49
bg print f0 " About "
bg locate 4 1
echo Interface manager for %OSname%
bg locate 5 1
echo version !globalversion!

bg.exe mouse >nul
goto finstartscr

:launchcmd
bg locate 1 39
bg print f0 " Command "
ping localhost -n 2 >nul
@echo.eCMD>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
exit

:runsaver
@echo.saver>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
exit

:savedata
if exist config_os\LogOS.settings del config_os\LogOS.settings
for /f "delims=" %%a in ('set') do (
@echo.%%a,>>config_os\LogOS.settings
)
exit /b

:viewprofile
call :background !rndcolor:~1!!rndcolor:~0,1! !topp! !botp!
bg locate 1 1
bg print 1f " Apps "
bg locate 1 8
bg print 2f " Settings "
bg locate 1 19
bg print 3f " Session "
bg locate 1 29
bg print f0 " Profile "
bg locate 1 39
bg print 5f " Command "
bg locate 1 49
bg print 0f " About "
bg locate 4 1
bg print !rndcolor! "User info"
if "%user%"=="" set falcon=fal&goto usertype
bg locate 6 1&bg print !rndcolor! "Name: %user%"
:usertype
bg locate 7 1
if "%user%"=="%adname%" bg print !rndcolor! "Type: Administrator"&goto viewtheme
if "%user%"=="%userg%" bg print !rndcolor! "Type: Standard user"&goto viewtheme
if "%user%"=="Guest" bg print !rndcolor! "Type: Guest"&goto viewtheme
bg locate 7 1
bg print !rndcolor! "Local system account"
:viewtheme
bg locate 9 1
bg print !rndcolor! "Theme: %rndcolor%"
bg mouse >nul
call :background dont !topp! !botp!
goto finstartscr

:sessionmenu
bg locate 1 19
bg print f0 " Session "
bg locate 2 19
bg print 0f " End session         "
bg locate 3 19
bg print 0f " Switch user         "
bg locate 4 19
bg print 0f " Shut down           "
bg locate 5 19
bg print 0f " Restart             "
bg locate 6 19
bg print 0f " Stand by            "
bg locate 7 19
bg print 0f " Hybrid sleep        "
bg locate 8 19
bg print 0f " Hibernate           "
bg locate 9 19
bg print 0f " Recovery mode       "
for /f "tokens=1- 3" %%a in ('bg mouse') do set y=%%a&set x=%%b
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;2" goto endsession
)
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;3" goto switchsession
)
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;4" goto shutdownsession
)
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;5" goto restartsession
)
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;6" goto standbysession
)
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;7" goto sleepsession
)
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;8" goto hibersession
)
for /l %%a in (19 1 39) do (
if "!x!;!y!"=="%%a;9" goto recoverysession
)
bg locate 1 19
bg print 3f " Session "
call :background dont !topp! !botp!
bg locate 1 19
bg print 3f " Session "
goto finstartscr

:setting
bg locate 1 8
bg print f0 " Settings "
bg locate 2 8
bg print 0f " Control panel       "
bg locate 3 8
bg print 0f " Personalization     "
bg locate 4 8
bg print 0f " User accounts       "
bg locate 5 8
bg print 0f " Legacy menu         "
for /f "tokens=1- 3" %%a in ('bg mouse') do set y=%%a&set x=%%b
for /l %%a in (8 1 28) do (
if "!x!;!y!"=="%%a;2" goto cpanel
)
for /l %%a in (8 1 28) do (
if "!x!;!y!"=="%%a;3" goto personalize
)
for /l %%a in (8 1 28) do (
if "!x!;!y!"=="%%a;4" goto usersettings
)
for /l %%a in (8 1 28) do (
if "!x!;!y!"=="%%a;5" (
for /l %%a in (1 1 3) do (
bg locate 5 8
bg print f0 " Legacy menu         "
ping localhost -n 1 >nul
bg locate 5 8
bg print 0f " Legacy menu         "
ping localhost -n 1 >nul
)
@echo.settings>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
exit
)
)
bg locate 1 8
bg print 0f " Settings "
::call :background dont !topp! !botp!
goto finstartscr

:cpanel

for /l %%a in (1 1 3) do (
bg locate 2 8
bg print f0 " Control panel       "
ping localhost -n 1 >nul
bg locate 2 8
bg print 0f " Control panel       "
ping localhost -n 1 >nul
)
:drawcp
call :savedata
bg locate 2 8
bg print f0 " Control panel       "
ping localhost -n 1 >nul
set ldm=true
color !rndcolor!
if "!user!"=="!adname!" set admincol=!rndcolor!
if "!user!"=="Guest" set guestcolor=!rndcolor!
if "!user!"=="!userg!" set usercolor=!rndcolor!
bg locate 2 8
bg print 0f " Control panel       "
ping localhost -n 1 >nul
set ldm=true
call :background !rndcolor:~1!!rndcolor:~0,1! !topp! !botp!

::window
set "dashes="
set "spaces="
::set /a marginx=30
set /a marginy=!screen_h!/5
set /a marginz=!marginy!+1
set /a wide=!screen_w!/2+2
set /a marginx=!screen_w!/2-(!wide!/2)
for /l %%a in (1 1 !wide!) do (
set "dashes=!dashes!-"&set "spaces=!spaces! "
)
bg locate !marginy! !marginx!
bg print f0 "+!dashes!+"
bg locate !marginz! !marginx!
set /a loopend=!marginz!+14
set /a loopstart=!marginz!+1
for /l %%a in (!loopstart! 1 !loopend!) do (
bg print f0 "|!spaces!|"
bg locate %%a !marginx!
)
bg print f0 "+!dashes!+"

::title label

set /a xp=!marginx!+2
set /a yp=!marginy!+2
bg locate !yp! !xp!
bg print f8 "Settings"

::title label

set /a xp=!marginx!+2
set /a yp=!marginy!+4
set /a allstart=!xp!+3
bg locate !yp! !xp!
bg print f1 "1. Personalization"
set /a per_yp=!yp!
set /a per_xend=!xp!+17
set /a yp+=1
bg locate !yp! !xp!
bg print f4 "2. Factory mode"
set /a fac_yp=!yp!
set /a fac_xend=!xp!+14
set /a yp+=1
bg locate !yp! !xp!
bg print f2 "3. User account settings"
set /a usr_yp=!yp!
set /a usr_xend=!xp!+22
set /a yp+=1
bg locate !yp! !xp!
bg print f3 "4. Micellaneous options"
set /a msc_yp=!yp!
set /a msc_xend=!xp!+21
if not "%user%"=="%adname%" (
set /a yp+=4
bg locate !yp! !xp!
bg print f0 "Some settings are managed"
set /a yp+=1
bg locate !yp! !xp!
bg print f0 "by your administrator."
)
::close button

set /a xp=!marginx!+!wide!
set /a yp=!marginy!
bg locate !yp! !xp!
set /a closexp=!xp!&set /a closeyp=!yp!
bg print fc "X"


:cinputpsetting
for /f "tokens=1- 3" %%a in ('bg mouse') do set y=%%a&set x=%%b
if "!x!;!y!"=="!closexp!;!closeyp!" call :background dont !topp! !botp!&goto finstartscr
for /l %%a in (!allstart! 1 !per_xend!) do (
if "!x!;!y!"=="%%a;!per_yp!" goto per_window
)
for /l %%a in (!allstart! 1 !fac_xend!) do (
if "!x!;!y!"=="%%a;!fac_yp!" goto factorysession
)
for /l %%a in (!allstart! 1 !usr_xend!) do (
if "!x!;!y!"=="%%a;!usr_yp!" goto usersettings
)
for /l %%a in (!allstart! 1 !msc_xend!) do (
if "!x!;!y!"=="%%a;!msc_yp!" goto miscoption
)
goto cinputpsetting

:personalize
for /l %%a in (1 1 3) do (
bg locate 3 8
bg print f0 " Personalization     "
ping localhost -n 1 >nul
bg locate 3 8
bg print 0f " Personalization     "
ping localhost -n 1 >nul
)
:drawper
call :background !rndcolor:~1!!rndcolor:~0,1! !topp! !botp!
:per_window
call :savedata
color !rndcolor!
if "!user!"=="!adname!" set admincol=!rndcolor!
if "!user!"=="Guest" set guestcolor=!rndcolor!
if "!user!"=="!userg!" set usercolor=!rndcolor!
::window

set "dashes="
set "spaces="
::set /a marginx=30
set /a marginy=!screen_h!/6
set /a marginz=!marginy!+1
set /a wide=!screen_w!/2+2
set /a marginx=!screen_w!/2-(!wide!/2)
for /l %%a in (1 1 !wide!) do set "dashes=!dashes!-"&set "spaces=!spaces! "
bg locate !marginy! !marginx!
bg print f0 "+!dashes!+"
bg locate !marginz! !marginx!
set /a loopend=!marginz!+25
set /a loopstart=!marginz!+1
for /l %%a in (!loopstart! 1 !loopend!) do (
bg print f0 "|!spaces!|"
bg locate %%a !marginx!
)
bg print f0 "+!dashes!+"

::title label

set /a xp=!marginx!+2
set /a yp=!marginy!+2
bg locate !yp! !xp!
bg print f8 "Settings > Personalization"

::close button

set /a xp=!marginx!+!wide!
set /a yp=!marginy!
bg locate !yp! !xp!
set /a closexp=!xp!&set /a closeyp=!yp!
bg print fc "X"

::background label

set /a xp=!marginx!+2
set /a yp=!marginy!+5
bg locate !yp! !xp!
bg print f0 "Background:"
:partialload
@echo.set topp=!topp!>"config_user\%user%_im.cmd"
@echo.set botp=!botp!>>"config_user\%user%_im.cmd"
::background tile settings

set /a yp=!marginy!+7
bg locate !yp! !xp!
set /a tile1xp=!xp!
set /a tile2xp=!xp!+1
set /a firstyp=!yp!
echo !topp!

set /a yp=!marginy!+8
bg locate !yp! !xp!
set /a tile3xp=!xp!
set /a tile4xp=!xp!+1
set /a secyp=!yp!
echo !botp!

::background color


set /a xp=!marginx!+15
set /a yp=!marginy!+7
bg locate !yp! !xp!
bg print f0 "Color: "&bg print f!rndcolor:~0,1! "!rndcolor:~0,1!"&bg print f!rndcolor:~1,1! "!rndcolor:~1,1!"
set /a bgfgyp=!yp!
set /a bgxp=!xp!+7
set /a fgxp=!xp!+8
::ok button

set /a xp=!marginx!+2
set /a yp=!marginy!+23
bg locate !yp! !xp!
bg print f0 "+------+"
set /a yp=!marginy!+24
bg locate !yp! !xp!
set /a ok_x=!xp!+1
set /a ok_y=!yp!
bg print f0 "|  OK  |"
set /a yp=!marginy!+25
bg locate !yp! !xp!
bg print f0 "+------+"
:inputpsetting
for /f "tokens=1- 3" %%a in ('bg mouse') do set y=%%a&set x=%%b
if "!x!;!y!"=="!bgxp!;!bgfgyp!" call :setbg&goto per_window
if "!x!;!y!"=="!fgxp!;!bgfgyp!" call :setfg&goto per_window
if "!x!;!y!"=="!tile1xp!;!firstyp!" goto settile1
if "!x!;!y!"=="!tile2xp!;!firstyp!" goto settile2
if "!x!;!y!"=="!tile3xp!;!secyp!" goto settile3
if "!x!;!y!"=="!tile4xp!;!secyp!" goto settile4
if "!x!;!y!"=="!closexp!;!closeyp!" call :background dont !topp! !botp!&goto finstartscr
set /a endloop=!ok_x!+5
for /l %%a in (!ok_x! 1 !endloop!) do (
if "!x!;!y!"=="%%a;!ok_y!" (
call :background dont !topp! !botp!
goto finstartscr
)
)
goto inputpsetting

:settile1
call :nexttile !topp:~0,1!
set topp=!tempe!!topp:~1!
goto partialload

:settile2
call :nexttile !topp:~1!
set topp=!topp:~0,1!!tempe!
goto partialload

:settile3
call :nexttile !botp:~0,1!
set botp=!tempe!!botp:~1!
goto partialload

:settile4
call :nexttile !botp:~1!
set botp=!botp:~0,1!!tempe!
goto partialload

:nexttile
if "%1"=="Í" set tempe=Û&exit /b
if "%1"=="Û" set tempe=±&exit /b
if "%1"=="±" set tempe=²&exit /b
if "%1"=="²" set tempe=°&exit /b
if "%1"=="°" set tempe=+&exit /b
if "%1"=="+" set tempe=.&exit /b
if "%1"=="." set tempe=Í&exit /b
set tempe=Í
exit /b

:setbg
if "!rndcolor:~0,1!"=="0" set rndcolor=1!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="1" set rndcolor=2!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="2" set rndcolor=3!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="3" set rndcolor=4!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="4" set rndcolor=5!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="5" set rndcolor=6!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="6" set rndcolor=7!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="7" set rndcolor=8!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="8" set rndcolor=9!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="9" set rndcolor=a!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="a" set rndcolor=b!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="b" set rndcolor=c!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="c" set rndcolor=d!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="d" set rndcolor=e!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="e" set rndcolor=f!rndcolor:~1!&exit /b
if "!rndcolor:~0,1!"=="f" set rndcolor=0!rndcolor:~1!&exit /b
exit /b

:setfg
if "!rndcolor:~1!"=="0" set rndcolor=!rndcolor:~0,1!1&exit /b
if "!rndcolor:~1!"=="1" set rndcolor=!rndcolor:~0,1!2&exit /b
if "!rndcolor:~1!"=="2" set rndcolor=!rndcolor:~0,1!3&exit /b
if "!rndcolor:~1!"=="3" set rndcolor=!rndcolor:~0,1!4&exit /b
if "!rndcolor:~1!"=="4" set rndcolor=!rndcolor:~0,1!5&exit /b
if "!rndcolor:~1!"=="5" set rndcolor=!rndcolor:~0,1!6&exit /b
if "!rndcolor:~1!"=="6" set rndcolor=!rndcolor:~0,1!7&exit /b
if "!rndcolor:~1!"=="7" set rndcolor=!rndcolor:~0,1!8&exit /b
if "!rndcolor:~1!"=="8" set rndcolor=!rndcolor:~0,1!9&exit /b
if "!rndcolor:~1!"=="9" set rndcolor=!rndcolor:~0,1!a&exit /b
if "!rndcolor:~1!"=="a" set rndcolor=!rndcolor:~0,1!b&exit /b
if "!rndcolor:~1!"=="b" set rndcolor=!rndcolor:~0,1!c&exit /b
if "!rndcolor:~1!"=="c" set rndcolor=!rndcolor:~0,1!d&exit /b
if "!rndcolor:~1!"=="d" set rndcolor=!rndcolor:~0,1!e&exit /b
if "!rndcolor:~1!"=="e" set rndcolor=!rndcolor:~0,1!f&exit /b
if "!rndcolor:~1!"=="f" set rndcolor=!rndcolor:~0,1!0&exit /b
exit /b

:endsession
for /l %%a in (1 1 3) do (
bg locate 2 19
bg print f0 " End session         "
ping localhost -n 1 >nul
bg locate 2 19
bg print 0f " End session         "
ping localhost -n 1 >nul
)
@echo.>log_user\LOGOUT.LOG
exit

:recoverysession
for /l %%a in (1 1 3) do (
bg locate 9 19
bg print f0 " Recovery mode       "
ping localhost -n 1 >nul
bg locate 9 19
bg print 0f " Recovery mode       "
ping localhost -n 1 >nul
)
:factorysession
@echo.recover>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
color !logoncolor!
exit

:shutdownsession
for /l %%a in (1 1 3) do (
bg locate 4 19
bg print f0 " Shut down           "
ping localhost -n 1 >nul
bg locate 4 19
bg print 0f " Shut down           "
ping localhost -n 1 >nul
)
@echo.shutdown>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
color !logoncolor!
exit

:standbysession
for /l %%a in (1 1 3) do (
bg locate 6 19
bg print f0 " Stand by            "
ping localhost -n 1 >nul
bg locate 6 19
bg print 0f " Stand by            "
ping localhost -n 1 >nul
)
@echo.standby>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
color !logoncolor!
exit

:sleepsession
for /l %%a in (1 1 3) do (
bg locate 7 19
bg print f0 " Hybrid sleep        "
ping localhost -n 1 >nul
bg locate 7 19
bg print 0f " Hybrid sleep        "
ping localhost -n 1 >nul
)
@echo.sleep>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
color !logoncolor!
exit

:hibersession
for /l %%a in (1 1 3) do (
bg locate 8 19
bg print f0 " Hibernate           "
ping localhost -n 1 >nul
bg locate 8 19
bg print 0f " Hibernate           "
ping localhost -n 1 >nul
)
@echo.hibernate>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
color !logoncolor!
exit

:restartsession
for /l %%a in (1 1 3) do (
bg locate 5 19
bg print f0 " Restart             "
ping localhost -n 1 >nul
bg locate 5 19
bg print 0f " Restart             "
ping localhost -n 1 >nul
)
@echo.restart>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
color !logoncolor!
exit

:switchsession
for /l %%a in (1 1 3) do (
bg locate 3 19
bg print f0 " Switch user         "
ping localhost -n 1 >nul
bg locate 3 19
bg print 0f " Switch user         "
ping localhost -n 1 >nul
)
call :background !rndcolor:~1!!rndcolor:~0,1! !topp! !botp!
bg locate 3 3
bg print f0 "+------------------------------+"
bg locate 4 3
bg print f0 "| What user account would you  |"
bg locate 5 3
bg print f0 "| like to switch to?           |"
bg locate 6 3
bg print f0 "|                              |"
bg locate 7 3
bg print f0 "| User name:                   |"
bg locate 8 3
bg print f0 "|                              |"
bg locate 9 3
bg print f0 "+------------------------------+"
bg locate 7 16
bg cursor 1
set /p switchuser=
bg cursor 0
@echo.switch !switchuser!>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
color !logoncolor!
cls
echo.
echo *** Log OS account switcher ***
echo.
echo Logging in...
echo User name: !switchuser!
exit
:appmenu
bg locate 1 1
bg print f0 " Apps "
bg locate 2 1
bg print 0f " Run..               "
bg locate 3 1
bg print 0f " List internal       "
bg locate 4 1
bg print 0f " List external       "
bg locate 5 1
bg print 0f " Stop sound playback "
for /f "tokens=1- 3" %%a in ('bg mouse') do set y=%%a&set x=%%b
for /l %%a in (1 1 22) do (
if "!x!;!y!"=="%%a;2" goto runapp
)
for /l %%a in (1 1 22) do (
if "!x!;!y!"=="%%a;3" goto listapps
)
for /l %%a in (1 1 22) do (
if "!x!;!y!"=="%%a;4" goto listextapps
)
for /l %%a in (1 1 22) do (
if "!x!;!y!"=="%%a;5" goto stopdev
)
bg locate 1 1
bg print 1f " Apps "
call :background dont !topp! !botp!
bg locate 1 1
bg print 1f " Apps "
goto finstartscr

:stopdev
for /l %%a in (1 1 3) do (
bg locate 5 1
bg print f0 " Stop sound playback "
ping localhost -n 1 >nul
bg locate 5 1
bg print 0f " Stop sound playback "
ping localhost -n 1 >nul
)
@echo.>>terminate
taskkill /F /IM bg.exe >nul 2>nul
for /l %%a in (1 1 25) do (
bg locate 5 1
bg print f0 " Stop sound playback "
ping localhost -n 1 >nul
bg locate 5 1
bg print 0f " Stop sound playback "
ping localhost -n 1 >nul
)
bg locate 1 1
bg print 1f " Apps "
call :background dont !topp! !botp!
bg locate 1 1
bg print 1f " Apps "
goto finstartscr

:listapps
for /l %%a in (1 1 3) do (
bg locate 3 1
bg print f0 " List internal       "
ping localhost -n 1 >nul
bg locate 3 1
bg print 0f " List internal       "
ping localhost -n 1 >nul
)
bg locate 6 0
cls
Echo.
Echo. Internal commands
Echo.
Echo. ?          = Shows avaible commands
Echo. Settings   = Shows setup for batch file
Echo. About      = Information about batch file
Echo. Explorer   = File explorer
Echo. Logoff     = Logs off
Echo. Restart    = Shutdowns and starts OS again
Echo. Notes      = Manage your notes
Echo. eCMD       = Starts Extended Command Prompt
Echo. Time       = Shows current time
Echo. Hibernate  = Saves session and shuts dowm
Echo. Standby    = Takes %OSname% to low power state
Echo. DiskInfo   = Shows info about disks
Echo. Type       = Types a file
Echo. Fastnote   = Quickly make notes
Echo. Hotboot    = Reboots system without rebooting the batch file.
Echo. Custom     = Manage custom applications
Echo. Calculator = Calculate numbers
Echo. Recover    = Reboot into recovery
Echo. Dance      = Shows colorful animation
Echo. Sleep      = Takes %OSname% to low power state and saves the session to disk.
Echo. Lock       = Locks current user account
Echo. PlayWAV    = Launches WAV media player
Echo. ASCIIview  = ASCII image viewer
echo.
Echo. Shutdown   = Closes batch file
echo.
bg.exe mouse >nul
call :background dont !topp! !botp!
goto finstartscr

:listextapps
for /l %%a in (1 1 3) do (
bg locate 4 1
bg print f0 " List external       "
ping localhost -n 1 >nul
bg locate 4 1
bg print 0f " List external       "
ping localhost -n 1 >nul
)
cls
Echo.
Echo. External commands
Echo.
set /a appid=1
for /f "delims=" %%a in ('dir /b apps_user') do (
call apps_user\%%a -getinfo !appid!
set cm=%%a
echo.   Command: !cm:.bat=!
echo.
set "cm="
set /a appid+=1
)
echo.
bg.exe mouse >nul
call :background dont !topp! !botp!
goto finstartscr

:runapp
for /l %%a in (1 1 3) do (
bg locate 2 1
bg print f0 " Run..               "
ping localhost -n 1 >nul
bg locate 2 1
bg print 0f " Run..               "
ping localhost -n 1 >nul
)
bg locate 3 3
bg print 0b "+------------------------------+"
bg locate 4 3
bg print 0b "| Run..                        |"
bg locate 5 3
bg print 0b "|                              |"
bg locate 6 3
bg print 0b "| Command: "&bg print !rndcolor:~1!!rndcolor:~0,1! "                   "&bg print 0b " |"
bg locate 7 3
bg print 0b "|                              |"
bg locate 8 3
bg print 0b "+------------------------------+"
bg locate 6 14
bg cursor 1
set /p runapp=
bg cursor 0
@echo.!runapp!>log_user\COMMAND.LOG
@echo.im>log_user\RETURN.LOG
cls
color !rndcolor!
exit

:background
if not "%1"=="dont" color %1
bg locate 0 0
set pattern1=%2
set pattern2=%3
set /a wide=!screen_w!/2
set /a tall=!screen_h!/2
set "line1="
set "line2="
for /l %%a in (1 1 !wide!) do set "line1=!line1!!pattern1!"
for /l %%a in (1 1 !wide!) do set "line2=!line2!!pattern2!"
set /a ypos=0
for /l %%a in (1 1 !tall!) do (
bg locate !ypos! 0
echo.!line1!
set /a ypos+=1
bg locate !ypos! 0
echo.!line2!
set /a ypos+=1
)
exit /b