X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=scriptlib%2FBatchFiles%2FSwitches.bat;fp=scriptlib%2FBatchFiles%2FSwitches.bat;h=04984a352a4a9bea82cb4ed988fb1dc515602426;hb=789b8160859f55b0be4b16cb2a92639ae41d3b51;hp=0000000000000000000000000000000000000000;hpb=b3a835050ab0797a5a3d94ba4e3b6a30670622ae;p=vbslib%2Fmain.git diff --git a/scriptlib/BatchFiles/Switches.bat b/scriptlib/BatchFiles/Switches.bat new file mode 100644 index 0000000..04984a3 --- /dev/null +++ b/scriptlib/BatchFiles/Switches.bat @@ -0,0 +1,39 @@ +@echo off +REM Character Encoding: "WHITE SQUARE" U+25A1 is □. +REM Debugging path may be depended on code page of command prompt and this file. +call :SetVariables "%~0" + +if "%~1" == "" %not_close% %cscript% //nologo "%vbslib_root%\vbslib Prompt.vbs" Switches "C:\ .swit" /g_debug_:1 +if not "%~1" == "" %not_close% %cscript% //nologo "%vbslib_root%\vbslib Prompt.vbs" Switches %1 +if not "%errorlevel%" == "21" ( pause ) + +goto :eof + + +REM ******************************************************************** +REM Function: SetVariables +REM ******************************************************************** +:SetVariables +if "%ProgramFiles(x86)%" == "" set cscript=cscript +if not "%ProgramFiles(x86)%" == "" set cscript=%windir%\SysWOW64\cscript.exe + +set close_at_end= +set not_close=cmd.exe /K + +call :GetParentPath "%~1" +call :GetParentPath "%ret%" +call :GetParentPath "%ret%" +set vbslib_root=%ret% + +goto :eof + + +REM ******************************************************************** +REM Function: GetParentPath +REM ******************************************************************** +:GetParentPath +set ret=%~dp1 +set ret=%ret:~0,-1% +goto :eof + +