-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgameslib.bat
More file actions
41 lines (37 loc) · 837 Bytes
/
gameslib.bat
File metadata and controls
41 lines (37 loc) · 837 Bytes
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
40
41
@echo off
setlocal EnableDelayedExpansion
set GAMESDIR=%~1
cls
set fileIndex=0
set file=""
echo -----------------------------------------------
echo Games List
echo -----------------------------------------------
for %%A in ("%GAMESDIR%*.*") do (
set /a fileIndex+=1
echo !fileIndex! - %%~nA
)
echo -----------------------------------------------
set /a fileIndex=0
set /P "G=Input a number:"
if "%G%" equ "" set "G=0"
for %%A in ("%GAMESDIR%*.*") do (
set /a fileIndex += 1
if "%G%"=="!fileIndex!" (
set file=%%A
goto GAMESBREAK
)
set file=lol
)
:GAMESBREAK
CD %GAMESDIR%
if not "%file%" equ "lol" (
for %%i in ("%file%") do (
set drive=%%~di
set path=%%~pi
set name=%%~ni
set ext=%%~xi
start "" "!name!!ext!"
)
)
cd /D "%~dp0"