Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Friday, August 29, 2008

Visual Studio - how to restore missing templates

 

DevEnv.exe /installvstemplates

The file is located (for vs2005) at:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE

Wednesday, May 14, 2008

Add Windows Explorer to your Visual Studio tools menu

Sometimes it is needed to access the project folder in Windows Explorer, but there is no easy way to do that using VS.

It can be solved by adding Explorer to External Tools in VS:

To set it up, click Tools, then External Tools..., then click Add.  Now enter the following data:
Title: Windows Explorer
Command: explorer.exe
Arguments: /select,"$(ItemPath)"

Leave Initial directory blank, and click OK.  Now when you click Tools, Windows Explorer, Windows Explorer will open with the current file you are editing selected.

Thursday, April 3, 2008

RunAs tweak

If you selected "Select a program from a list of installed programs", you would get this much more useful dialog instead:

image

The registry hack will show you the second Open With dialog instead of that irritating first one.

Manual Registry Hack

Open regedit.exe through the start menu search or run box, and then browse down to the following key (create the key if it doesn't exist)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\

Windows\CurrentVersion\Policies\Explorer

image

Create a new 32-bit DWORD value on the right-hand side with the following values:

  • Name: NoInternetOpenWith
  • Value: 1

The change should be immediate, no need to restart anything. To reset back to default, set the value to 0 or delete the key.

 

Source

Saturday, March 22, 2008

Vista: Removing old files after sp1 installation

Type vsp1cln.ext in command prompt.

After this, it is not possible to uninstall sp1.

Tuesday, March 18, 2008

Add Windows Explorer to Visual Studio tools menu

To set it up, click Tools, then External Tools..., then click Add.  Now enter the following data:
Title: Windows Explorer
Command: explorer.exe
Arguments: /select,"$(ItemPath)"

Leave Initial directoy blank, and click OK.  Now when you click Tools, Windows Explorer, Windows Explorer will open with the current file you are editing selected.

Friday, February 15, 2008

Add "Copy to" to Windows context menu

To enable a Copy To Folder option in the right-click menu when right-clicking a file or folder you have to add one key to the Registry. Use Windows R to open the run dialog and enter regedit in there. Now navigate to the Registry key HKEY_CLASSES_ROOT \AllFilesystemObjects \shellex \ContextMenuHandlers. You will notice the Send To entry there. Right-click the ContextMenuHandlers entry and select New > Key from the list.

Name that key Copy To and click ok. Now double-click the default entry on the left pane and give it the value {C2FBB630-2971-11D1-A18C-00C04FD75D13}.

 

Source

Friday, February 1, 2008

Use Path.GetRandomFileName() or Path.GetTempFileName() when working with temp files

Do not reinvent function for generating unique name for temporary files. Use one of the existing methods:

 

Source

Conditional breakpoints in Visual Studio

You can specify a breakpoint condition which will be evaluated when a breakpoint is reached. The debugger will break only if the condition is satisfied.

To specify a condition:

  1. In a source window, right-click a line containing a breakpoint glyph and choose Condition from Breakpoints in the shortcut menu. Conditional Breakpoint
  2. In the Breakpoint Condition dialog box, define a boolean condition using the code in your local scope. For example, you can only break when _culture != "en-US".
  3. Choose Is true if you want to break when the expression is satisfied or Has changed if you want to break when the value of the expression has changed.
  4. Click OK.

 

Source

Saturday, September 29, 2007

Firefox - new profile

Step 1: Start Firefox and export your bookmarks as a file on your hard-drive (we'll need them later).

fast firefox browser

Step 2: Type firefox.exe - P in the Run box of Windows. (see screenshot)

Step 3: Click the Create Profile button without making any modifications to your existing profile (which is normally called "default")

Firefox Very Slow

Now when you Start Firefox in the new profile, you are very likely to be impressed with the speed. You can import the bookmarks that you saved in Step 1. If you have made any changes to the Firefox Dictionary, copy the persdict.dat word list file from the old profile folder to the new one.

Yes, there won't be any old Firefox add-ons in the new profile but the browser will be extremely quick and won't hog the CPU - just the way you want Firefox to run on your computer.

And if you ever need to revert to the old profile, just type Firefox -P again and click the old profile. Nothing is lost.

 

Source

Friday, September 7, 2007

Tracking Down Svchost Process

In CMD window write:

tasklist /svc

Saturday, August 25, 2007

Ms Word tips

Where Was I? I get up and walk around frequently when I’m writing—gets the blood flowing. Sometimes I close a document I am editing, and when I come back to it and open it up, I just hit Shift + F5 to return to the exact place in the document where I was editing.

Serial Saves. If you’re like me, you often have many documents open at once. For safety’s sake, I like to frequently save all of them at once. To do this, hold down the Shift key when you go to the File menu. This changes Save to Save All.

Paragraph Hopping. You can circumvent the multi-step process of cutting, pasting and deleting to move paragraphs with an easy paragraph hopping feature. Often when I’m writing, I decide that a given paragraph would work better above or below another one. Do this: Go into a document with several paragraphs and put your cursor at the beginning of one of the middle paragraphs. Hold down the Shift and Alt keys in unison, then use the up and down arrow keys to “hop” the paragraph to new positions in the document.

One Fell Swoop Word Deletion. You can delete entire words with your keyboard. Just put your cursor at the beginning of the word and press Ctrl and Del together. This is very useful when editing.

Customize Line Spacing and Alignment. The Ctrl key is your best buddy when you want to experiment with line spacing and alignment variations. Ctrl + 1 provides single spacing, Ctrl + 2 provides double spacing and Ctrl + 5 provides 1-1/2 line spacing. Ctrl + R right aligns a paragraph, Ctrl + L left aligns one, and Ctrl + E centers one.

Quick Selecting. You can select all text between the current location of your cursor and the end of the current paragraph by hitting Ctrl + Shift and the down arrow.

 

Ctrl + [ or ], de- or increases the font of the selected text with 1 point.

 

Ctrl + “+” for subscript and ctrl + shift + “+” for superscript

 

Shift + F3 changes the case of selected text — UPPER — lower — Sentence case.

 

After ctrl-Z you can step back your changes by using Ctrl Y.

 

Press Control + Shift + C to copy the formatting and styles.

 

Select the location of the text where the formatting and style needs to be applied, and then
Press Control + Shift + V to paste the style and formatting (including Colors, Fonts, Font sizes, Paragraph styles, Headings and everything else).

Microsoft Keyboard Shortcuts

Source

Friday, August 3, 2007

Remove Old Drivers After Upgrading to New Hardware

If you are experiencing weird issues after upgrading your hardware, or you've just upgraded to the latest hardware device and aren't seeing the performance you'd like, you might want to remove the old drivers which are still installed for the old hardware, even though you can't normally see them in device manager.

What you have to do is set a less-known flag to allow you to see non-present devices, and then launch device manager. You'll then see the old devices in the list, and can uninstall the drivers for them.

In Windows Vista, the first thing you'll need to do is open a command prompt in administrator mode. Type cmd into the start menu search box, and then use Ctrl+Shift+Enter to open in administrator mode. (You can also right-click on the command prompt and choose Run as Administrator)

Now paste in the following line:

SET DEVMGR_SHOW_NONPRESENT_DEVICES=1

Then type in devmgmt.msc to start up Device Manager from the administrator command prompt.

Once you are in Device Manager, go to the View menu and choose Show Hidden Devices, which will show all the device drivers including things that aren't currently installed in your computer.

You can right-click on the driver and then choose Uninstall from the menu to remove the drivers for that old hardware.

I've found that this can resolve a lot of weird issues, and even increase performance on some machines where you've upgraded a ton of times. This isn't necessarily going to increase performance, but it's nice to have a tidy computer nonetheless.

This tip also works the same in Windows XP.

Source

Friday, July 13, 2007

Control Firefox Tabs With Your Keyboard

Firefox makes mouse-less browsing a breeze with these simple shortcuts:
  • Ctrl T will open a new tab
  • Ctrl shift T will undo closed tab
  • Ctrl Page Up and Ctrl Page Down will scroll through your tabs
  • Ctrl Number will bring you instantly to a certain tab.  eg. If you hit Ctrl and ?3? you will go to the third tab
  • Ctrl D will bookmark the current tab
  • Ctrl Shift D will bookmark all the tabs in the window