OSDN Git Service

Version 5.91
[vbslib/main.git] / scriptlib / BatchFiles / Switches.bat
1 @echo off\r
2 REM Character Encoding: "WHITE SQUARE" U+25A1 is □.\r
3 REM Debugging path may be depended on code page of command prompt and this file.\r
4 call :SetVariables "%~0"\r
5 \r
6 if     "%~1" == ""  %not_close%  %cscript% //nologo "%vbslib_root%\vbslib Prompt.vbs"  Switches  "C:\  .swit"  /g_debug_:1\r
7 if not "%~1" == ""  %not_close%  %cscript% //nologo "%vbslib_root%\vbslib Prompt.vbs"  Switches  %1\r
8 if not "%errorlevel%" == "21" ( pause )\r
9 \r
10 goto :eof\r
11 \r
12 \r
13 REM ********************************************************************\r
14 REM  Function: SetVariables\r
15 REM ********************************************************************\r
16 :SetVariables\r
17 if     "%ProgramFiles(x86)%" == ""  set cscript=cscript\r
18 if not "%ProgramFiles(x86)%" == ""  set cscript=%windir%\SysWOW64\cscript.exe\r
19 \r
20 set close_at_end=\r
21 set not_close=cmd.exe /K\r
22 \r
23 call :GetParentPath "%~1"\r
24 call :GetParentPath "%ret%"\r
25 call :GetParentPath "%ret%"\r
26 set vbslib_root=%ret%\r
27 \r
28 goto :eof\r
29 \r
30 \r
31 REM ********************************************************************\r
32 REM  Function: GetParentPath\r
33 REM ********************************************************************\r
34 :GetParentPath\r
35 set ret=%~dp1\r
36 set ret=%ret:~0,-1%\r
37 goto :eof\r
38 \r
39 \r