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