-
Notifications
You must be signed in to change notification settings - Fork 7
/
run.bat
33 lines (31 loc) · 833 Bytes
/
run.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@echo off
:main
echo 1. Qbus To ESX
echo 2. ESX To Qbus
set /p choice=Enter choice:
if %choice% == 1 goto qbus
if %choice% == 2 goto esx
goto main
:qbus
@REM set /p file=Enter file url:
call :filedialog file
node src/index.js %file% qbustoesx
start output.lua
ping -n 5 localhost >nul
cls
goto main
:esx
@REM set /p file=Enter file url:
call :filedialog file
node src/index.js %file% esxtoqbus
start output.lua
ping -n 5 localhost >nul
cls
goto main
:filedialog :: &file
setlocal
set dialog="about:<input type=file id=FILE accept='.lua,.txt'><script>FILE.click();new ActiveXObject
set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);
set dialog=%dialog%close();resizeTo(0,0);</script>"
for /f "tokens=* delims=" %%p in ('mshta.exe %dialog%') do set "file=%%p"
endlocal & set %1=%file%