Start here

jQuery Datapicker cannot attach itself to an HTML element using the id selector in a APS.net

When using the jQuery Datapicker in connection with a HTML form, I have had cases where the Datepicker has been unable to attatch itself to a HTML element by its id selector name. Browsing the internet for a possible solution to this problem, I found an explanation stating that the problem is that the javascript attaching the Datapicker to the HTML element executes before the browser has completed rendering the HTML and DOM structure. The solution would be to postpone the execution of the javascript until the HTML structure has been completely rendered. Whether this is a valid explanation or not, I cannot say, however I can describe what has worked for me in a similar situation.

In connection with a ASP.NET form, where the Datepicker was attached to a TextBox having the attribute  id=”txtDatePicker”, the Datapicker wasn’t appearing as expected when users clicked in the text field.

The code which wasn’t working properly was as follows:

$(document).ready(function() {
$(function() {
$("#txtPickupDate" ).datepicker({ dateFormat: "D, d M yy" }); });
});

With just a few changes the Datepicker starts working properly. Here is the code that actually works for me:


var txtDatePicker = '#txtDatePicker';
$(document).ready(function() {
$(function() {
$( txtPickupDate ).datepicker({ dateFormat: "D, d M yy" }); });
});

The first change is the addition of the first line of code , in which a variable containing the id selector’s name: “txtDatePicker” is declared. The second change is in the fourth line where the variable is then used to reference the id selector instead of using the literal value to access the input field.  These changes were enough to get the Datepicker working for me!

By Jens Vejrup Lassen

Why is my WiFi network adapter so slow?

Really slow WiFi performance

Sometimes a laptop or other WiFi enabled device on the company or home WLAN shows deplorable perfomance, and it just doesn’t makes sense, because the device works properly, but just on other WiFi networks. The cause of your problem might just be congestion in the WiFi environment in the vicinity of your WLAN.

To troubleshoot the problem you could

  1. install a network monitor, for example Netstumbler, to discover wireless networks in your vicinity or
  2. open a command window in elevated mode, and execute this command:
    c:>netsh wlan show all

If you discover wireless networks nearby, you should make a note of the channels being used by your WLAN and the other WLANS, if one or more is using the same channel as your WLAN, you may have found the problem. Try changing the channel on your WiFi router to a unused channel and test whether this may be the solution to your slow WiFi performance.

By Jens Vejrup Lassen

For more information regarding troubleshooting WLAN problems see this page.
And more information regarding sniffing networks here.

Sample unattend.xml for use with Sysprep on Windows 7

See Main Article: How to Clone Windows 7 using Norton Ghost 15 and Microsoft Sysprep

Although there are quite anumber of scenarios for the use of Sysprep, I have found it useful to add an answer-file to the preparation process, answer files being generated using the Windows System Image Manager (WSIM). The WSIM with the Windows Automated Installation Kit (WAIK), which can be downloaded here, and see this article to learn how to use WSIM.  Using an answer-file when running Sysprep makes it possible to run Sysprep automatically and set a number of configuration options that otherwise would have to be entered manually while operating Sysprep from its GUI.

The following a sample unattend.xml which works reasonably well for beginners, however as you get more familiar with the Sysprep process you might want to modify this sample file or even create your own unattend.xml file from scratch!

unattend.xml

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <NetworkLocation>Work</NetworkLocation>
                <ProtectYourPC>1</ProtectYourPC>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <SkipUserOOBE>true</SkipUserOOBE>
            </OOBE>
            <!-- Uncomment the following section to set display settings -->
         <Display>
            <ColorDepth>32</ColorDepth>
            <DPI>120</DPI>
            <HorizontalResolution>1024</HorizontalResolution>
            <RefreshRate>60</RefreshRate>
            <VerticalResolution>768</VerticalResolution>
         </Display>

            <RegisteredOwner>My.owner</RegisteredOwner>
            <RegisteredOrganization>My.Org</RegisteredOrganization>
            <TimeZone>GMT+1</TimeZone>
        </component>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>da-DK</InputLocale>
            <SystemLocale>da-DK</SystemLocale>
            <UILanguage>da-DK</UILanguage>
            <UserLocale>da-DK</UserLocale>
        </component>
    </settings>
    <settings pass="generalize">
        <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
        </component>
        <component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipRearm>1</SkipRearm>
        </component>
    </settings>
    <settings pass="specialize">
        <!--
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ProductKey>BVXBC-BW6K8-VDQ26-TB3TW-HHM3T</ProductKey>
            <CopyProfile>false</CopyProfile>
        </component>
        -->
        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Identification>
                <JoinWorkgroup>Workgroup</JoinWorkgroup>
            </Identification>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="catalog:c:/win7x86/extract/sources/install_windows 7 ultimate.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Create a Ghost 15 drive image of a Windows 7 Reference Computer

See Main Article:How to Clone Windows 7 using Norton Ghost 15 and Microsoft Sysprep

To create a drive image of a Windows 7 computer using Norton Ghost 15, you will need a Windows 7 reference computer prepared with Sysprep for disk imaging. and a Custom Symantec Recovery Disk or bootable USB to boot up the reference computer with and make a drive image.

Follow this procedure to make a Ghost 15 image of Windows 7:

  1. Install and configure your Windows 7 reference computer including all third party software and updates.
  2. Create a Custom Symantec Recovery Disk or USB Stick
  3. Prepare the Windows 7 reference computer for making a Norton Ghost 15 drive image. See Sysprep for disk imaging.
  4. After preparing the reference computer for copying with Sysprep, boot it up with your Custom Symantec Recovery Disk, making sure that the BIOS boot priority has been changed to reflect the need to boot off of a DVD or USB stick.

    Symantec Recovery Utility is booting up

    Symantec Recovery Utility is starting up

  5. Accept the EULA

    Accept the EULA

  6. Norton Ghost 15 is now running on the reference machine and you should select the Back Up My Computer option from the menu.

    Select Back up your computer

  7. The back up welcome screen appears – click Next.

    Welcome screen – click next

  8. Select the drive to be copied til and image file, and click Next.
  9. Map a network drive to your storage device, unless you are using a local storage device.

    Map a network drive

    Network drive mapped

  10. The screen shows your choices, if you are ready to proceed. Click Next.

    Select the network mapped drive.

  11. Rename the file that will contain the drive image. Click Next.

    Rename the drive image file.

    Ready to click Next.

  12. Enter an appropriate description of the drive image file (or not). Click Next.
  13. Symantec Recovery Disk is  now ready to perform the backup operation. Click Next.

    Completing the Backup Computer Wizard.

  14. The next screen shows that the back up operation is in progress.

    Backup operation in progress.

    Backup process completed.

  15. The backup process has completed the creation of a drive image file and the reference computer may be shut down or restarted.

    Restart reference computer

  16. Click Yes to restart the reference computer.

Related links:

Cloning a Windows 7 reference computer with Sysprep and Norton Ghost 15.

By Jens Vejrup Lassen

Restoring a Ghost 15 drive image of Windows 7 to a Target Computer

See Main Article: How to Clone Windows 7 using Norton Ghost 15 and Microsoft Sysprep

Restoring a Ghost 15 drive image to a target computer, whether it be the original computer or another computer with the same HAL, requires the following prerequisites:

The procedure for applying the drive image to a target computer is as follows:

  1. Boot up the target computer with your Custom Symantec Recovery Disk or bootable USB stick.

    The Symantec Recovery Disk is booting up

    The Symantec Recovery Disk is starting up after boot straping

  2. Click on Recover My Computer selection from the menu

    Select Recover My Computer from the menu

  3. Click Next on the Recover My Computer Welcome screen.

    Click Next on Welcome page

  4. Click on Map a Network Drive.

    Click on Map a Network Drive.

  5. Enter security credentials for the networked mapped drive and click OK.

    Enter credentials for the network mapped drive and click OK.

  6. Click Browse to search for the appropriate drive image file.

    Click Browse to find a drive image file.

    Finding the drive image file

  7. Having selected the appropriate drive image file, click Next.

    Having selected the appropriate drive image file, click Next

  8. Click on Edit to change boot setting for the target computer.

    Click on Edit to change boot setting for the target computer.

  9. Make sure that you select the following options:
    • “Set Drive Active”
    • “Restore original disk signature”
    • “Restore Master Boot Record”.”

    Set the MBR settings

  10. Click Finish on the Recover My Computer Wizard, and then Yes on completing the Recover My Computer Wizard.

    Completing the Recover My Computer Wizard.

    v

  11. A this point the drive image file will be copied to and applied to the target computer. The time elapsed at this stage will naturally depend on the size of the drive image to be copied to the target.

    Applying the drive image to the target computer.

  12. Close the dialog when the program has finished applying the drive image to the target computer.

    Close the Restore My Computer wizard

  13. Click Exit and Yes to complete the process.

    c

  14. Warning: at this point the target computer will reboot and will normally not be able to boot up because the MBR is missing or defective. You will then have to use the Windows 7 installation DVD to repair the Windows installation, see below.
    (See the following article for a further discussion of this issue: W7 wont boot after restoring Ghost image to new hard disk)

    The target is unable to boot because of a defective MBR record.

  15. Boot the target computer with a Windows 7 installations DVD.

    Windows 7 installation DVD boots up

  16. Select the appropriate language option, English should do just fine. On the next screen chose Repair Your Computer from the menu.

    Welcome screen language options

    Welcome screen – select Repair Your Computer.

  17. The setup program will search for a Windows OS to repair when you have selected the option to Repair and Restart.

    ss

  18. When setup has located the OS, select the Repair option, and then click Next. At the next menu choose Startup Repair.

    Click Next to proceed

    Choose the Startup Repair option from the menu.

  19. The entire Startup Repair process will normally need to be repeated a total of three times to repair the startup, sometimes less, but don’t count on it.When the startup has been fixed, the target computer will boot up and this will signal the start of the Sysprep mini-setup process, which you specified in the answer-file when running Sysprep on the reference computer.  The mini-setup is handsoff, if  no errors have been comitted in the preparation process. (Preparing a reference computer with Sysprep) ADD LINK.

    Starting the target computer after the Repair This Computer process

  20. The first stage of the Sysprep setup updates registry settings, after which Windows services are started.

    Sysprep setup updates the Registry

    Sysprep setup starts services

  21. Sysprep setup then installs devices on the target computer.

    Sysrep setup is installing devices

  22. At this stage the target computer will automatically reboot to continue the setup process.

    Sysprep setup continues after rebooting the target computer

  23. The target computer restarts automatically.

    Starting Windows 7 for the second  stage

  24. Setup prepares the target computer for first logon and use.

    Last step before the logon screen shows up

  25. The target computer is now ready for first use, the user name that shows up in the screen shot below is an user account with administrative rights which was configured on the reference computer just before running Sysprep (Preparing a reference computer with Sysprep) ADD LINK

    Windows 7 Welcome Screen

    Desktop on target Windows 7 computer

    Related links:

    Cloning a reference computer using Sysprep and Norton Ghost 15.

    By Jens Vejrup Lassen

Using Sysprep to prepare a Windows 7 system for making a drive image with Norton Ghost 15

See Main Article: How to Clone Windows 7 using Norton Ghost 15 and Microsoft Sysprep.

Microsoft recommends running the Sysprep command (Microsoft on Sysprep) on the reference computer prior to transferring the image to a target computer, even if the target computer has the same hardware as the reference computer. This is done in order to generalize the image prior to transferring it, and to enable the operation of an automatically initiated mini setup process after booting up the target computer for the first time after transferring the image. Transferring an image from a reference computer to a target computer without running Sysprep is not supported.

Running Sysprep with the generalize option removes the reference computer’s name, SID, and other computer specific information you don’t want to replicate to the target computer.

Although there are quite anumber of scenarios for the use of Sysprep, I have found it useful to add an answer-file to the preparation process, answer files being generated using the Windows System Image Manager (WSIM). The WSIM with the Windows Automated Installation Kit (WAIK), which can be downloaded here, and see this article to learn how to use WSIM.  Using an answer-file when running Sysprep makes it possible to run Sysprep automatically and preprogram a number of options that otherwise would have to be entered manually while operating Sysprep from its GUI.

The answer-file I use sets the following configuration options:

  • Hides the EULA Page
  • Calls the network location “Work”
  • Skips the user and machine OOEBs
  • Set the display parameters
  • Name of owner “The Owner”
  • Name of organization “The Organization”
  • Input locale, system locale, UI language and User locale = “en-UK”
  • Skips rearm. (To avoid having to reinstall the reference computer after runing Sysprep three times)
  • Set the product code (which you must obviously change to the one you will be using.).
  • Joins the computer to a workgroup (not a domain)
  • and many more option (see the file itself).

If you require a more elaborated usage of the answer-file you should read this excellent article.

However for the purpose of this article, you should be able to use Sysprep by following this procedure:

  1. Install Windows 7 and customize your reference computer.
  2. Get a copy of the answer-file and customize its details to suit your own organization’s requirements.
  3. Save the answer-file  in the file system at: %systemroot%Windowssystem32sysprep.
  4. Create a command-file: sysprep.cmd with the following one line and save it to %systemroot%Windowssystem32sysprep.
    [sourcecode language="vb"]
    %Systemroot%System32SysprepSysprep.exe /shutdown /oobe /generalize /unattend:”%Systemroot%System32Sysprepunattend.xml”
    [/sourcecode]

    Save files in Sysprep folder

  5. Start the Task List and kill the process “wmpnetwk.exe “, if this process can be seen for all users. (Without this step Sysprep will fail!).

    Use the task list to kill the wmpnetwk.exe process.

  6. Start cmd.exe in the folder: %systemroot%Windowssystem32sysprep.
  7. Execute sysprep.cmd from the command line.

    Sysprep is preparing the reference computer for making a drive image.

  8. When Sysprep has completed generalizing the reference computer it will shut down, and it is time to capture the drive image.
    If you let the reference computer  to boot up to the operating system, it will execute the automatic setup procedure, and will have redo the procedure. So pay attention, and capture that drive image before the reference computer reboots!

    Reference computer shutting down after Sysprep completes execution.

You are now ready to make a drive image of the reference computer.

Related links:
How to Clone Windows 7 using Norton Ghost 15 and Microsoft Sysprep
By Jens Vejrup Lassen

How to clone Windows 7 using Norton Ghost 15 and Microsoft Sysprep

Cloning or replicating Windows 7 using Norton Ghost 15 and Sysprep

Deploying  Windows system images to new computers saves system administrators a lot of time, as you are able to prepare a reference machine with all necessary updates and third-party software ready to be cloned and replicated, making rapid and consistent deployment of new work stations relatively easy. This procedure was until the advent of Windows 7 an acceptable practice, however it has been drawn to my attention that Microsoft does not support a number of possible replication scenarios (Unsupported uses of Sysprep).  Regardless of this, I find it interesting to experiment with various deployment methods, and it is ultimately up to the individual organization to seek advice on the legality of any particular deployment scenario, so on that note, I will describe in the following a simplified way of cloning Windows 7 computers using Norton Ghost 15 and Sysprep.

This article is the main article and to be able to use the procedure will require reading all the subvarticles, which are linked when necessary.

Prerequisites:

  1. A reference computer on which to install Windows 7 (A Microsoft Virtual PC will suffice).
  2. A target computer (a physical or virtual machine)
  3. A Windows 7 installation DVD
  4. Symantec’s Norton Ghost 15 installation files with valid product code.
  5. Custom Symantec Recovery Disk or bootable USB stick.

Procedure  – is subdivided into fives steps. Each step, except 2, is described in a separate, linked article.

  1. Create a Custom Symantec Recovery Disk or USB stick .
  2. Install Windows 7 on the reference computer with all appropriate programs and updates.
  3. Use Sysprep to prepare the reference computer for making a drive image.
  4. Using the Custom Symantec Recovery Disk or USB stick make a drive image of the reference computer.
  5. Use the Custom Symantec Recovery Disk or USB stick to transfer the drive image to one or more target computers.

If you follow the above 5-step procedure as directed, you should have no problems replicating or cloning reference computers.

As mentioned above, this procedure may no longer be supported by Microsoft, who would like to see administrators  use the free MDT 2010 deployment solution. See Misasi for further information on this topic.

By Jens Vejrup Lassen

How to Extract Product Keys From a Windows 7 installation and other Applications

How to extract a forgotten product key from Windows 7

Sometimes you find yourself in the situation where you need to reinstall the OS or some software, but you  can’t find the darn product key!  Magical Jelly Bean offers a small keyfinder program that may be able to help you.

This small freeware program can be downloaded from their website and may be obtained in two versions: a freeware version and a paid version, the difference between the versions being the fact that the paid for version has a much larger scope (3000+) than the freeware version, however that might be, the freeware version is still able to extract product keys for over 300 programs, which may easily suffice, and even if you should find it necessary to acquire the paid for version, its price is a bargain at aproximately 24 USD.

I found the product extremely easy to use, you install it (avoiding the attempt to get you to install the AVG product) and run it immediate thereafter. The GUI displays the products and product key it finds on your computer, please note that the freeware program misleadingly calls a Windows 7 operating system Vista However despair not, as the product key will be correctly decyphered.

by Jens Vejrup Lassen

Installing Microsoft Virtual PC under Windows 7

If you need to work with different versions of operating systems, for testing or whatever, you might just as well do it virtually instead of fooling around with an array of physical machines!  To do so you could install the Microsoft Virtual PC framework on your Windows work station or server. Get Microsoft Virtual PC here.

Microsoft gives you the choice of installing the Virtual PC with or without Windows XP-mode, and this is where I normally choose to include the Windows XP-mode to be prepared for any eventual Windows XP program-compatibility issues, however this is a matter of taste, so for the sake of this article I will go for Microsoft Virtual PC on its own.

Step 1.

Get Microsoft Virtual PC here.

Click on the Download button.

Step 2.

Go with the option without Windows XP mode.

Step 3.

Select your operating system and language and click on the Download button

You will download a file called “Windows6.1-KB958559-x86-RefreshPkg.msu“, and install it. This is actually a Windows update, which might already have been installed, in which case you will not be required to install it.

Step 4.

Reboot your machine if required, and you will now find Windows Virtual PC in your program list:

Your PC is now capable of creating a virtual machine, more on which in a later posting.

by Jens Vejrup Lassen

How to Run Norton Ghost 15 from a DVD or USB stick (Windows 7)

If you need to make a Ghost image of your drive or need to restore a Ghost image to your drive, you will have to boot up the computer with a copy of Symantec Recovery Disk.

The following procedure may be used for that purpose:

Firstly make sure you have the following Prerequisites:

  • A stationary or laptop computer running Windows 7.
  • A Custom Symantec Recovery Disk ISO file ( Link ).
  • A writeable DVD or bootable USB stick ( Link  ).
  • An external drive to write to which the Ghost image may be stored or from which it may be retrieved.

Procedure:

  • Insert the writeable DVD in the slot or the bootable USB stick in its port.
  • Creating the bootable USB -stick
    1. Locate the Custom Symantec Recovery Disk ISO file in the file system, and extract its contents to a temporary folder in the file system.
    2. Copy all files and folders found in the temporary folder to the USB stick.
  • Creating the bootable DVD
    1. Burn the Custom Symantec Recovery Disk ISO to your DVD (Try using Magic ISO)

Your DVD or USB stick is now capable of booting the computer and running Norton Ghost 15.

Related article:
How to clone Windows 7 using Norton Ghost 15 and Microsoft Sysprep

by Jens Vejrup Lassen