Archive for November, 2007
The following ruby script when given any executable file path as the argument runs it in administrative mode.
In Vista you can do the same by right clicking on the file and selecting “Run as Administrator” but this script allows you to run a process in admin mode using the command line.
The ShellExecute function resides in the shell32.dll and is documented here.
By just giving “runas” as the second parameter to the function the process is executed in the administrative mode.Read Full Post | Make a Comment ( 1 so far )
Here is small ruby script that picks up a random image from a given folder and sets it as the desktop wallpaper.
The constant SOURCE_FOLDER can be changed to point at the folder which contain all your wallpaper and the script then randomly chooses a wallpaper from the collection.
You can also set your task scheduler to run this script automatically after a fixed interval so that your desktop wallpaper keeps changing.
Here is the pastie.Read Full Post | Make a Comment ( 2 so far )
Here is a neat little trick that I often find useful for renaming mp3 files with wrong names and correct tag titles. Just run this ruby script in the directory where you have stored your songs and it will read the tag title and rename the current file using it.
This script requires id3lib gem for ruby which can be installed simply by running the command:
gem install id3lib-ruby
One thing to notice in the script is that currently it works only on windows, but only with a little modification it can be made to work on other OSes as well (The only change I guess will be in the 5th line).
Here is the pastie link for this code.Read Full Post | Make a Comment ( 4 so far )
According to this link http://www.computerworld.com/action/article.do?command=printArticleBasic&articleId=9048658 SP3 has made XP significantly faster.
Like users needed another reason for not migrating to VISTA.Read Full Post | Make a Comment ( None so far )