Friday, March 30, 2012

Windows Batch File to Overcome Repeating Tasks


Every time we work on any project we need to open putty, winscp3 along with multiple folders, documents and web-pages. I do this every time I start working on the project, so to simplify a bit I tried something with batch files to make it easier to open related things for a project in one go. This sample file will
1) open the putty and login into it automatically.
2) open the winscp3 and login into it automatically.
3) open webpages http://all.alcatel-lucent.com/, http://google.com/, and http://lightreading.com
4) open this document D:\Documents and Settings\avatsyay\My Documents\R&A\MigratingToJboss6\DeploymentOnJboss6.doc
5) open folder My Docuemnts and Eclipe

Here is the sample batch file


@echo off
set ProgRoot32=%ProgramFiles%
set ProgRoot64=%ProgramFiles%


if not "%ProgramFiles(x86)%" == "" set ProgRoot32=%ProgramFiles(x86)%


REM Start an File Explorer that stays inside the specified folder.
REM Remove the /ROOT parameter (leave the comma) to disable folder lock.
%SystemRoot%\explorer.exe /ROOT, C:\jboss-6.1.0.Final\server\default\log\


REM Start a 32-bit application. Replace with %ProgRoot64% if running 64-bit app.


REM Open a few applications
start "Putty" "D:\Documents and Settings\avatsyay\My Documents\Softwares\putty.exe" -ssh change_myuser@172.x.x.x -pw change_mypassword
start "WinSCP3" "C:\Program Files\WinSCP3\WinSCP3.exe" change_WinscpSavedSessionName
start "Eclipse" "C:\eclipse_helius\eclipse.exe" -data "D:\Documents and Settings\avatsyay\workspace"


REM Open a couple webpages
start "My Alcatel Lucent" "http://all.alcatel-lucent.com/"
start "My Google" "http://google.com/"
start "MY Light Reading" "http://lightreading.com"


REM Open a document (simulates a double-click)
start "My Document" "D:\Documents and Settings\avatsyay\change_Mydoc.doc"
One more use I'll put this file to: opening all the things which I need on system startup. This can also be done by keeping all this in windows startup script but I see a benefit: In weekdays it won't start unless I double click that script ;)

Don’t forget to modify the document, folder and login details accordingly (highlighted in the above sample)

references:Wikipedia

Monday, March 12, 2012

Camping trip at sattal


This trip has been the most wonderful of all the ones I had; even the rafting trip at Rishikesh, which was remarkably good, has been left behind. We had an wonderful train journey, pleasant weather, awesome ambiance and a lot of fear factor involved. In one word I will say the trip had been 'Fantabulous' \m/

The wow factor in this trip were: train journey, which was enjoyed with triangular coatpees card game and lot of jokes :D, the no-electricity camps, the leopards fear and FMS group :P

The time we were having our welcome drinks we were knocked by the fact that Leopards are surprise guests who pay visit to the camp occasionally. Still I don't believe my friends who said that they if they would have known this guest earlier they still would have came. I believe, known this fact most of us would have backed out and this trip would had been a dream, thanks to the organizers  who let this fact hidden from us :P
Despite all this the trip had been wonderful and we enjoyed it to the fullest. A few members of FMS group were nice and we enjoyed the volley game with them.


The fun or I should say fear part was sleeping in the camp, as around 4 the in morning we were awaken by some animal near our camp which we thought was leopard but actually it was striker passing through the camp.



The bonfire was bad, as it included altercations and I really don't like all boys bonfire, as to me it's boring and most of the time it ends up with altercation over non-trivial topics. Also the our decision to visit Nanital was super boring, as we didn't had much time and the only thing we did there was a silly boat ride. Instead I would have enjoyed staying at the camp, playing volley with FMS and seeing the FMS off the camp :D

All in all I really liked this trip and, though, in start I didn't wanted to visit the camp again but in the end I loved it and I might revisit it again \m/