2 Apr 2013

VBS Shutdown Timer

When running time comsuming processes I often wish to shutdown automatically after a given time. There are several applications on the internet but I was not really happy with the ones I found. So, I put together a really small VB-Script which in fact does the job perfectly.

Dim Shell : Set Shell = CreateObject("WScript.Shell")

argument_t = inputbox("Time in Seconds:", "Shutdown", "3600")

Shell.Run "C:/Windows/system32/shutdown.exe -f -s -t " & _
          argument_t, 0

MsgBox "Press OK if you want to cancel the Shutdown..", _
       vbInformation + vbOkayonly, "Cancel Shutdown"

Shell.Run "C:/Windows/system32/shutdown.exe -a", 0

I put the vbs file on my disk and a shortcut to it on the Desktop. You can choose the time until shutdown with an input box.



14 Mar 2013

Example Code for a Customized RSS-Feed

A short code snippet for the customized RSS-Feed on this Google-Blogger site. I simply added the below code to a gadget to yield a tailored RSS-Feed in the sidebar. Most of the code was grabbed from the Google Code Playground.



Land Tirol





    
 

Loading...

11 Mar 2013

MS Word 2010, Find & Replace with Wildcards

Quite often I need to re-format citations in my texts, i.e., missing brackets around the year of a publication. In MS Word I simlpy solve such issues with the find and replace option using wildcards. I.e. for the issue with years without brackets:

short cut crtl-h
then put ([1-2][0-9]{3}) in the find-box and
(^&) in the replace box
hit 'replace' and you're done

The find string will search for any 4-digit number starting with 1 or 2 followed by 3 digits between 0 and 9 and will be replaced by the same number put inbetween round brackets. Note that the brackets in the find-string denote a token which then can be referenced by the string ^& in the replace step.