OpenSecurity/cygwin64/Cygwin.vbs
author om
Mon, 02 Dec 2013 14:02:05 +0100
changeset 3 65432e6c6042
permissions -rwxr-xr-x
initial deployment and project layout commit
     1 Option Explicit
     2 
     3 ' ------------------------------------------------------------
     4 ' start a cygwin shell
     5 '
     6 ' Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
     7 '
     8 ' Copyright (C) 2013 AIT Austrian Institute of Technology
     9 ' AIT Austrian Institute of Technology GmbH
    10 ' Donau-City-Strasse 1 | 1220 Vienna | Austria
    11 ' http://www.ait.ac.at
    12 ' ------------------------------------------------------------
    13 
    14 ' ------------------------------------------------------------
    15 ' This starts a cygwin shell within a relocatable cygwin
    16 ' folder but without a DOS shell window prior. The idea is
    17 ' to do it like in this BAT snippet below:
    18 '
    19 '		@echo off
    20 ' 		SET INSTALL_DRIVE=%~d0
    21 ' 		SET INSTALL_FOLDER=%~p0
    22 ' 		SET CYGWIN_BIN="%INSTALL_DRIVE%%INSTALL_FOLDER%bin"
    23 ' 		SET CYGWIN_BASH="%INSTALL_DRIVE%%INSTALL_FOLDER%bin\bash"
    24 ' 		%INSTALL_DRIVE%
    25 ' 		chdir "%CYGWIN_BIN%"
    26 ' 		start mintty.exe %CYGWIN_BASH% --login -i
    27 '
    28 ' ------------------------------------------------------------
    29 
    30 ' setup the basic objects
    31 Dim cFSO
    32 Dim cShell
    33 Set cShell = CreateObject("WScript.Shell")
    34 Set cFSO = CreateObject("Scripting.FileSystemObject")
    35 
    36 ' parse script location and cd into folder
    37 Dim sPath
    38 sPath = Wscript.ScriptFullName
    39 sPath = cFSO.GetAbsolutePathName(sPath)
    40 sPath = cFSO.GetParentFolderName(sPath)
    41 cShell.CurrentDirectory = sPath
    42 
    43 ' locations of mintty and bash
    44 Dim sMinTTYPath
    45 Dim sBashPath
    46 sMinTTYPath = """" & sPath & "\bin\mintty" & """"
    47 sBashPath = """" & sPath & "\bin\bash" & """"
    48 
    49 ' start a cygwin shell
    50 cShell.Run sMinTTYPath & " " & sBashPath & " --login -i", 1, false