Friday, December 21, 2012

Always run Visual Studio as administrator under Windows 8

This is a default state for many developers and this functionality is available under properties menu in Windows 7 but has vanished in Windows 8.

In order to enable VS running as administrator in Windows 8:

you have to right-click devenv.exe and select "Troubleshoot compatibility".

1. select "Troubleshoot program"
2. check "The program requires additional permissions"
3. click "Next", click "Test the program..."
4. wait for the program to launch
5. click "Next"
6. select "Yes, save these settings for this program"
7. click "Close"


Saturday, November 10, 2012

Windows context menu – Flag directory

So I’ve been looking for a while an option to flag a directory with “Moved” folder.

Why would I need it? Well, for example, when downloading a torrent files, I would like to move some of the content but in the same time to keep the originals for seeding. So in order to remember what was moved and what wasn’t I would have to:

1. Create a new folder
2. Rename it to some name, like “Moved”

The fastest way to do this is by Ctrl+Shift+N and renaming.

Sounds simple, but when doing it a lot you start thinking about automation.
So here is a simple code which can update your registry to add 2 options:

1. Right click on any folder on the Windows Explorer side bar would have “Mark Moved” entry

2. In the right click menu inside a folder, New menu would have “Mark Moved” entry


Copy the following to a text file, rename .txt to .reg and run.

Windows Registry Editor Version 5.00
"Command"="\"CMD\" /D /E:ON /c for /F \"tokens=*\" %%a IN (\"%1\") do md \"%%~dpa\\Moved\""
"FriendlyTypeName"="Mark Moved"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Mark Moved]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Mark Moved\command]
@="CMD.EXE /C MD \"%1\\Moved\""

The information was merged form the following two sources:

Next steps would be to add an icon to the explorer toolbar or ribbon.

Tested on Windows 8.

Thursday, November 8, 2012

Error 0xE8000012 when connecting iPhone to iTunes after migration to Windows 8

Took me to long to find an solution, but it works only for jailbroken iPhones:
Using any file browser on the phone (like iFile) browse to /var/root/Library and delete Lockdown folder.

Sunday, September 16, 2012

Threads in WinRT


Just a small example that shows the use of Task.

private async void Button_Click(object sender, RoutedEventArgs e)
    string text = await Task.Run(() => Compute());
    this.TextBlock.Text = text;