Search This Blog

23 October 2013

Make sure that the correct version of Visual Studio is opened using a batch file

I like most of other developers have several versions of  Visual Studio installed on my computer and it can be a hassle to get the correct version to open using a batch file.

I have a batch file that starts up the program that I normally use during the day and in this I have a start of Visual Studio. Now that Visual Studio 2013 has arrived I installed this on my machine that already have Visual Studio 2012 and 2010.

For my current project I need to use Visual Studio 2012 (due to an old TFS) so I want the batch file to start the correct version.

I have the followin line in the batch file

start /d "D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\" devenv.exe

This started to start up Visual Studio 2013 anyway and I couldn't understand why until I stumble upon the solution on another webpage.

I turns out that Windows associates devenv with a specified directory path through a setting in the register

My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe

This key was set to 

D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe

which meant that Visual Studio 2013 was started, to get Visual Studio 2012 to start instead I just needed to change the register setting to

D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe

Problem solved!

14 January 2013

Customize lockscreen for Windows 7

I recently worked in an office complex and was a bit depressed as so many people in the office just let their Windows 7 installation use the default lockscreen view.

The default lockscreen image is the standard blue screen which is kind of nothing. Most people that use a computer change their background in Windows but since Microsoft made the change of lockscreen image so much harder not that many changes the lockscreen image.

The change of lockscreen image is actually quite easy even if you have to perform some manual work to get it ok.

First of all you need administrator rights on the computer since either you have to dive into the register and edit a key yourself or using the group policy editor. Then you need to be able to put your prefered image in the correct directory and you will be done.

Follow the steps below and you will have you own lockscreen image and be the envy of your colleges at the office.

1. Type "Edit Group Policy" in the startmenu and run the corresponding option.
2. Expand the node "Administrative Templates"
3. Expand the node "System"
4. Locate and select the node "Logon"
5. Locate the option "Always use custom logon background"
6. Double click the option and mark the option as "Enabled"
7. Apply and close the dialogs that are opened.
8. Locate the image you want to use.
9 Make sure that the image matches you screen resolution since the image will be stretched by windows to fullscreen.
9. The image need to be max 256kb in size otherwise windows will ignore it.
10. Rename the image to "backgroundDefault.jpg"
11. Place the image in the directory "%windir%\System32\oobe\info\backgrounds\" create any missing subdirectories.
12. Done!

If the image doesn't show make sure that the "Always use custom logon background" is enabled and that the image is at the correct position with the correct name and hasn't a size greater than 256kb.

If you rather edit the register yourself then you can ignore the steps 1-7 and instead do the following
1. Open RegEdit
2. Locate the node "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background"
3. Edit (or add as a DWORD) the key OEMBackground and set the value to 1
4. Continue with step 8 above.