How to bulk unblock files in Windows 7 or Server 2008

In Windows 7 (actually any of the latest Windows releases) you will find that files copied to your local drives are not trusted until you right-click on them and in the properties click the ‘Unblock’ button. This is all very well for one or two files, but gets extremely tedious with more. It turns out to be related to NTFS’s ability to allow alternate data streams.

So here is a simple method of mass or bulk unblocking files.

  1. Download the Sysinternals Streams.exe from http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx
  2. I find Sysinternals so useful I create a ‘SysInternals’ folder on my C: drive and then put this into my ‘path’ environment variable so that I can run them from anywhere. However, if this is too much then the easiest is to copy the streams.exe to the root folder you wish to have files unblocked.
  3. In a command windows, use ‘cd’ to navigate to your folder.
  4. Type the command ‘streams –s –d subfoldername’ and press enter.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 9/1/2010 at 7:57 AM
Tags: , , , ,
Categories: .Net Development | Windows | Windows 7 | security
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

SQL script to kill all connections to a SQL Server database

I have finally perfected a nice script for killing connections to databases. Although basic, I found many of the ones I google'd, had one problem or another that stopped them working straight away, which just wastes time. This one works! I have just used it.

Just replace the database name and it's good. It is easy to alter it to work across a list of databases too.

-- =============================================
-- Author:        Nicholas Rogoff
-- Create date: 04/03/2010
-- Description:    Script that Kills all connections to a database
-- except the current one
-- =============================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
 
DECLARE    @execSql NVARCHAR(1000)
DECLARE @databaseName VARCHAR(100)
DECLARE @NoKilled INT
 
-- *** CHANGE THE NAME OF THE DATABASE *** ---
SET @databaseName = '#### Replace this with a database name here ####'   
  
PRINT 'START: Killing active connections to the "' + @databaseName + '" database'  
 
-- Count Connections
select @NoKilled = COUNT(*)  
from master.dbo.sysprocesses   
where db_name(dbid) = @databaseName   
 and  
 DBID <> 0   
 and  
 spid <> @@spid 
  
-- Create the sql to kill the active database connections   
set @execSql = ''  
select @execSql = @execSql + 'kill ' + convert(char(10), spid) + ' '  
from master.dbo.sysprocesses   
where db_name(dbid) = @databaseName   
 and  
 DBID <> 0   
 and  
 spid <> @@spid   
exec (@execSql)   
 
PRINT 'END: Killed "' + CAST(@NoKilled AS VARCHAR(4)) 
+ '" active connections to the "' + @databaseName + '" database'  
 
 
GO

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 3/4/2010 at 4:23 AM
Tags:
Categories: SQL | SQL Server | T-SQL
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

How to fix Adobe PDF preview in 64 bit Windows

This will fix previews in both Outlook and Windows explorer on Windows 7 64 bit machines.

If you get

This file cannot be previewed because of an error with the following previewer: PDF Preview Handler for Vista

in outlook when trying to preview PDF's or just get no previews of PDF's in explorer..

..then try the following.

Caution: Changing the registry should be done with great care?so make a backup of any changes!

  1. Start the Registry editor by using Start->Run (or Windows Key + R) and type regedit and click OK
  2. Expanding the tree to locate
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{DC6EFB56-9CFA-464D-8880-44885D7DC193} and select it.
  3. Now to make a backup of the previous settings just in case this does not work for you, right-click on the branch in the left pane and select export. Choose a location you can find again later (just in case! Although you should do this for any registry changes too.). You only need to export the selected branch. Windows 7 automatically takes full registry snapshot in case of major problems.
  4. Now on the right hand side double-click to edit the AppID value and change it to {534A1E02-D58F-44f0-B58B-36CBED287C7C}.
  5. I preview started working immediately even without restarting outlook! However you may need to restart?

Now, I can't take credit for this brilliant solution. I found it at http://bink.nu/news/fix-adobe-pdf-preview-handler-on-64-bit-windows.aspx and only write it again here to make it easier to find for all! Why adobe don't fix this I am not sure!

See also http://nrogoff.spaces.live.com/blog/cns!A5B6DA80CCEA9EBC!1593.entry

Technorati Tags: ,,,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 1/15/2010 at 2:52 AM
Tags: , , , , ,
Categories: Windows 7
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Easy Deep Zoom Panoramas with Microsoft?s ICE

Microsoft Research have produced a great panorama application that requires almost no input at all! It?s called Microsoft Image Composite Editor (ICE).

image

Now there are several programs out there that will do panoramas and you probably got one with your camera. However what is really great with this is the stitching algorithm seems very good and best of all is the very easy export to Deep Zoom Tileset!

(For more info on Deep Zoom see http://msdn.microsoft.com/en-us/library/cc645050(VS.95).aspx or for the very good Deep Zoom Composer application for creating them go to http://msdn.microsoft.com/en-us/library/dd409068.aspx)

It can also export in a new format called HD View.

(For information on this tool and plug-in see http://research.microsoft.com/en-us/um/redmond/groups/IVM/HDView/HDcreate.htm.)

You just add your images and the rest is pretty much done for you. I have quickly tried it a on a couple of panorama I took while on holiday in Spain. These are the out the box Deep Zooms and took no other intervention from me. 5 minutes and done.

This one was taken on a tripod using a Nikon D300. 15 Images.

Click to see Deep Zoom Panorama of the Villa

and this using a compact Panasonic DMC-FT1 camera hand held, but using the Panorama help function. 7 Images.

Click to see Deep Zoom Panorama of Andalucia

You can get and download ICE for free at http://research.microsoft.com/en-us/um/redmond/groups/ivm/ICE/

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 9/12/2009 at 2:40 AM
Categories: Silverlight | Deep Zoom
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Creating alternative sub-sites in a Publishing Site in SharePoint (MOSS)

It is easy to be lead into believing that you can only create another Publishing site as a sub-site of an existing Publishing site in SharePoint 2007 (MOSS). This is however only because that is the only site template on offer to you by default.

There are two things you can do. Use command line methods for adding sites or allow more templates to be used. For reasons only known to Microsoft they have made the second option a struggle to find. 

The easy way to manage which Site Templates is to simply add the following the URL of the Main publishing site

/_Layouts/AreaTemplateSettings.aspx

example:

http://www.MyPublishingSite.com/_Layouts/AreaTemplateSettings.aspx

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 8/6/2009 at 1:30 PM
Tags: , ,
Categories: MOSS
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Changing the MS Office 2007 Product Key ? 32 and 64-bit

Just installed Office to discover that the Key I used has been used too many times and the activation fails. Follow the either of the two instructions below to allow you to put in an alternative key (if you have one!).

If you are using  a 64-bit operating system then Office detects it and install slightly differently. The registry key(s) on 64-bit are at

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\12.0\Registration

Mike?s Blog that explains how to do this (http://bloggingabout.net/blogs/mglaser/archive/2006/12/12/Change-Office-2007-Product-Key.aspx)

or

the Microsoft  KB Article ?How to change the product key for Office XP, for Office 2003, and for the 2007 Office system? (http://support.microsoft.com/default.aspx/kb/895456)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 7/25/2009 at 4:21 AM
Categories: Office 2007 | Office
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Project Web Access Site Error - "The administrator has taken this farm offline. Project Web Access is not available at this time"

I have recently had this error when finishing my Project Server 2007 installation on an existing SharePoint 2007 server farm.

After creating the Project Web Access site (in my case using a host header), I received the following error message

?The administrator has taken this farm offline.  Project Web Access is not available at this time?

The trick here is to remember to take the farm out of Quiesce mode!

  1. You must go to Central Administration > Operations > Quiesce Farm
  2. click the 'Reset' button 
  3. Now try your PWA URL in a browser. The page should render after some time.

Once the site is live 'un-Quiecsed' the PWA should jumped into life and the two project services (Microsoft Office Project Server Queue Service and Microsoft Office Project Server Events Service)will start automatically

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 6/27/2009 at 5:20 AM
Tags: ,
Categories: MOSS | Project Server
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Using Windows Live Writer to publish blogs

This post has been written and publish using Windows Live Writer. It seems to work with quite a wide range of blog engines. This particular blog is based on BlogEngine.NET which works well with Live Writer. It also works with a Windows Live blogs, SharePoint blogs and I am sure a lot more.

image

Live writer has great facilities for making writing blogs extremely easy and allows publishing to multiple blogs too. It very cleverly downloads your skins, which give you the feel of writing on your blog page. Full spell checking and the usual good word processing facilities.

You can download Windows Live Writer from Microsoft at http://download.live.com/writer and a whole host of other free ?Live? software at http://download.live.com/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 6/10/2009 at 2:30 AM
Categories: BlogEngine.NET | Windows
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Double underlining in web pages and CSS

If you have been wondering how to get double underlines on your web page to use as sepcial anchors, here are some simple examples:

Simple double underline

CSS:

text-decoration: underline;
border-bottom: 1px solid black;

 

With colour on 2nd line

CSS:

text-decoration: underline;
border-bottom: 1px solid #FF3399;

With dotted and thicker line

CSS:

text-decoration: underline;
border-bottom: 3px dotted black;

With dashed line

CSS:

text-decoration: underline;
border-bottom: 3px dashed black;

Thick, dashed and colour

CSS:

text-decoration: underline;
border-bottom: 3px dashed #FF3399;

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 5/1/2009 at 6:20 AM
Tags: , , , , ,
Categories: CSS | Web development
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Silverlight Toolkit - Install and get going really quickly!

This is a idiots instruction set to help people new to the Silverlight Toolkit to get using controls and style very fast. I found I had to search around to understand how to implement this highly useful set of tools.

Quick Pre -Reqs

  • Uninstall any previews or beta of expressions blend. Best to reboot after this.
  • Ensure you have SP1 for Visual Studio 2008 installed
  • Ensure you have the Silverlight Tools installed (Click here for Microsoft download)

Installing

  1. Download the Toolkit from http://www.codeplex.com/Silverlight
  2. Extract the files to a folder on your local hard drive. Usually this will be where you keep other 3rd party dll's or references.
  3. You should have a folder structure something like:
    Screen shot of folder structure
  4. Now open the Silverlight project in Visual studio and add the references to the project by selecting 'Add References...' from the 'Project' menu.
  5. Click on the 'Browse' tab and select each of the binaries in the root folder.
  6. Now you need to add the tool items to your Toolbox. First I recommend creating a new tab. Do this by right-clicking anywhere on the toolbox and selecting 'Add Tab'.
  7. Name the Tab 'Silverlight Toolbox'.
  8. Now right-click on the 'Silverlight Toolbox' bar and click 'Choose items...'
  9. Select the 'Silverlight Components' tab, and click 'Browse...'
  10. Locate each of the dll's except 'Microsoft.Windows.Controls.Theming.dll' which has no controls. This should add the controls to your toolbox that looks something like:

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: nrogoff
Posted on: 2/15/2009 at 11:26 AM
Tags: , , ,
Categories: .Net Development | Silverlight
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed