Wednesday, April 1, 2009

Perl script inside a DOS Batch file

Whenever I wanted to invoke a utility passing a file as an argument I used to create a shortcut of the utility in the Send To folder, as described here :

How to Add Items to the "Send To" Menu

But how to have a Perl script in the "Send To" menu??

I got an idea when browsing through this page :

DOS Batch - Interfacing non DOS Software

I created a batch script as described in the page. Then modified the part of the batch file where the Perl script actually starts.

I wanted to have a utility that can encrypt/decrypt a text file. A basic encryption was sufficient, so considered the Caesar cipher.

I completed the script and added it to the Send To menu.
Link to the script

A small modification to the above script to handle binary files. Here is the link.

1 comments:

Wolf said...

Perl is the best scripting language for Text processing and handle regex. I have posted few articles related to those at my blog

http://icfun.blogspot.com/search/label/perl

Also Perl's Cpan has lots of support that I don't even need to think extra while developing project. I didn't find such help on other programming language except Java and .NET