-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathstartBuffer.bat
More file actions
39 lines (38 loc) · 1.44 KB
/
Copy pathstartBuffer.bat
File metadata and controls
39 lines (38 loc) · 1.44 KB
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
33
34
35
36
37
38
39
setlocal enabledelayedexpansion
set batdir=%~dp0
set drive=%~d0
set bciroot=output
set subject=test
rem get date/session
For /f "tokens=1-3 delims=/-. " %%a in ('date /t') do (set session=%%c%%b%%a)
rem get time
For /f "tokens=1-4 delims=: " %%a in ('time /t') do (set block=%%a%%b%%c)
set pyfolder=dummy
if exist %batdir%\getBufferSaveDir.py (
rem check if python is installed in path
for %%X in (python.exe) do (set FOUND=%%~$PATH:X)
if defined FOUND (
rem This is a horrible hack to get the output of the sub-command into a variable
For /f "usebackq delims=" %%o in (`%batdir%\getBufferSaveDir.py`) do (set pyfolder=%%o)
)
)
if %pyfolder%==dummy (
echo Default location
mkdir "%drive%\%bciroot%\%subject%"
mkdir "%drive%\%bciroot%\%subject%\%session%"
mkdir "%drive%\%bciroot%\%subject%\%session%\%block%"
set folder="%drive%\%bciroot%\%subject%\%session%\%block%"
) ELSE (
echo Python location
set folder=%pyfolder%
)
if exist "%folder%\raw_buffer" (
set folder=%folder%_1
mkdir %folder%_1
)
rem Search for the buffer executable
if exist "%batdir%buffer\bin\win32\recording.exe" (set buffexe="%batdir%buffer\bin\win32\recording.exe" )
if exist "%batdir%buffer\win32\recording.exe" (set buffexe="%batdir%buffer\win32\recording.exe" )
if exist "%batdir%buffer\bin\recording.exe" (set buffexe="%batdir%buffer\bin\recording.exe" )
if exist "%batdir%recording.exe" ( set buffexe="%batdir%recording.exe" )
%buffexe% %folder%\raw_buffer %*