Thursday Jul 30, 2009

Using Cygwin to manage script Virtual Box tasks

The Virtual Box GUI doesn't do everything one needs and so I have been experimenting with using cygwin, a free to use bash shell library. Having installed CYGWIN the first thing to do is add the Virtual Box program folder to the PATH, in my case,

    export PATH=/cygdrive/c/Program\\ Files/Sun/xVM\\ VirtualBox:${PATH}

I want this placed in the .bashrc so its always invoked, and thus need to test if is already in the path. I use this code,

    type -p VBoxManage.exe > /dev/null
    case $? in
    0)   # Its already there
         : ;;
    1)   # Add Path
         export PATH=/cygdrive/c/Program\\ Files/Sun/xVM\\ VirtualBox:${PATH} ;;
    esac

Now I need to associate a script file type with an execution program. I have tried to use the distributed batch file and binary and neiter of these work, so I have copied cygwin.bat to bash.bat and amended it so that it reads as follows

    @echo off

    :: Dave Levy (c) 2009         Is this GPL?
    :: bash.bat                   Version 1.0

    :: Wrapper to run \*sh scripts from windows explorer/desktop

    c:\\ksh\\bin\\bash --login %\*

I have deleted the -i flag from the bash line, I have made the bash program call absolute, %\* is the DOS batch command file syntax equivilant to $\* i.e. all the command line arguments, so the command line invokes bash.exe in login mode to force the execution of .bash_profile and .bashrc and appends all the other command line parameters including the script file name. :: is a neater comment delimiter than REM. I have associated my batch file with the file type .ksh as the open method using explorer.

Much of CYGWIN is distributed under the GPL and I am unclear if the batch file is included, If so, its GPL since I created the file by copying it.

keywords: howto invoke cygwin scripts from the windows desktop, write a dos batch file to invoke shell

tags:

Thursday Jul 02, 2009

Virtual Box 2.2.4 & Windows XP

And with one might bound he was free..................

I downloaded Virtual Box 2.2.4 a couple of days ago, but when I tried to install it on my XP SP/3, the install process failed and rolled back. This trouble ticket, #3701 details how to fix the windows registry which was damaged at v2.2.0.

Thanks to those who helped me find it.

tags: ""

Friday Jun 20, 2008

An motd in tcl for Windows XP

I bought an external disk from Amazon for my main home machine, which runs windows and have been moving various user's 'My Documents' folders onto the disk. It has a seperate power supply and switch so its quite easy to start the computer and forget the disk, so I have written a program to check and remind people. I have written it in tcl/tk, my main documentation is on my snipsnap, but its a jolly short program, quick to write and easy to install. Use [Read More] below to check out the code and/or download it.

tags:

[Read More]

Saturday Feb 11, 2006

Windows Help and Support

I've just bought a new computer which I shall be using for music, pictures and for my games, so I am running windows XP on it.

There's been a problem with "Help & Support", it wouldn't start on using the F1. It stated the service was not running and I couldn't find it in the services tab of msconfig. Dell recommended a pcrestore, which since I had aleady done once, I didn't want to repeat. I logged it in the Dell Community forum here... and joe53 referred me to Kelly's Korner tweaks, line 235. This is a registry update. I used this to fix the problem and I have documented my process on the Dell Site. Kelly puts this problem as No 3 in the Top 10 FAQs, although I had not heard of it before.

Thanks to Joe & Kelly.

tags: ""

About

DaveLevy

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
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
    
       
Today