Localizing SpecFlow

On a recent usergroup meeting I got introduced to SpecFlow. This opened a whole new world in formulating tests ans specifications. Although I’ve been trying to formulate my tests in a BDD manor, inspired by JP Boodhoo’s and Stefan Liesern’s BDD examples this feels much better.

So the next logical step would be to move to a natural german specification instead of having the original given-when-then syntax.

Turns out, that switching the language is actually really easy. Even though I didn’t seem to find anything on the web … You just have to adjust the app.config like this

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="specFlow"
      type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler,
            TechTalk.SpecFlow"/>
  </configSections>
  <specFlow>
    <language feature="de-DE" tool="" />
  </specFlow>
</configuration>

And that’s all that’s to it.

Windows 7 Backup encountered a problem

I just recently started to backup my Windows 7 machine using the buildin backup capabilities of Windows 7.

However this doesn’t work as expected. Event though everything seemed to be backed up, I still got an error that a file was skipped during back.

Backup encountered a problem while backing up file C:\Windows\System32\config\systemprofile\Podcasts. Error:(The system cannot find the file specified. (0x80070002))

This is strange. The file does not exists, but why does Windows want to backup that file if it doesn’t exist? There are just some mysteries still to be solved.

However, there seems to be a KB article for this problem. I suppose the problem has something to do with me uninstalling Zune from my system, which most likely created a podcasts folder for me (which I didn’t want in the first place).

So I searched in my profile and found a podcasts folder which I removed.

Batch Parameter

Even though PowerShell is actually becoming the de-facto standard for scripting, there are still a whole lot of batch-scripts which are used for every day tasks and need to be maintained. And event there are always new things to discover.

To pass parameters to a batch-file isn’t really something new. With %1, %2 and so on you can access those parameters within the script. Noteworthy might be the fact, that %1 is the first parameter, while %0 is the name of the script itself.

What I didn’t know so far where some extra variables like %~f0, %~d0, %~p0 … as well as combinations like %~dp0; but then again, I’m not really so much into batch-scripting.

Here is a little overview about what I recently discovered, maybe it helps for someone else:

Description Example
%~f complete path inlc. filename C:\winnt\system32\x.cmd
%~d drive letter C
%~p path \winnt\system32
%~dp complete path C:\winnt\system32
%~sp short path C:\Progra~1\Intern~1 (for C:\Programme\Internet Explorer)
%~x file extension .cmd
%~nx filename incl. extension x.cmd
%~sx short file extension .doc (for .document)
%~a file attributes
%~t date and time of a file
%~z size of a file