Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Wednesday, 18 April 2012

How to Press and Send Ctrl-Alt-Del in Remote Desktop Connection Window

Remote Desktop Connection client allows user to remotely connect and administer another Windows computer that is running Microsoft Terminal Services. As with most remote control system or even virtualization process, which effectively and virtually run two or more system on a single physical machine, user will have problem to trigger Control-Alt-Delete (Ctrl+Alt+Del) keyboard shortcut key combination.
Ctrl-Alt-Del keyboard shortcut has been commonly used since IBM PC with DOS era to perform soft reboot, and used in modern Windows system to activate Winlogon process (log on to Windows NT), open Task Manager or Windows Security dialog box that allows user to log off, lock computer, shutdown PC, run Task Manager, switch user and other functions.

However, whenever trying to trigger Ctrl-Alt-Del function on remote system connected via Remote Desktop Connection, the keyboard shortcut combination pressed will bring up the Ctrl+Alt-Del function on the local machine instead of the machine remotely logged on via RDC.

This behavior is by design though, as Ctrl-Alt-Del key combination is too important for any PC (to run especially when computer encounters halt error or hang). As such, Ctrl-Alt-Del keyboard shortcut is always reserved for local host computer.

In order to send Ctrl-Alt-Del keystrokes to remote computer connected via Remote Desktop client, just press the following workaround:

Ctrl+Alt+End

Monday, 9 May 2011

How to get the Windows user identity name in Silverlight.


Silverlight Windows User Identity Name

Introduction

This article explains how to get the Window User Identity Name in Silverlight without using WCF.

Background

I was looking for Windows Authentication for Silverlight on the web. After Binging and Googling for a while, I found most of them use a WCF service to do the Windows authentication, where the primary objective is to just get the current user name. I thought using WCF for just getting the Windows user is kind of overkill, and moreover, you have to configure your basicHttpBinding to incorporate Windows authentication with WCF, which is kind of trivial, but can turn painful if not configured properly.

Below are three quick and easy steps to achieve the objective:

  1. Open the ASPX page that carries the Silverlight XAP file inside the Object tag and add a new param (let's call it Initparams):

<param name="Initparams"
  value="UserAccount=<%=HttpContext.Current.User.Identity.Name%>" />

  1. Open the App.xaml.cs file and declare a global variable:

public static string UserID = string.Empty;

To the application_startup method in App.xaml.cs, assign the param value to the global variable (this should be before the RootVisual statement):

UserID = e.InitParams["UserAccount"];

  1. Declare a variable in your Mainpage.xaml or the navigation page, and assign the global variable value to the local variable, and you have the current logged on Windows user name.

string UserAccount = App.UserID;


Saturday, 30 April 2011

Reading registry from 64 bit application

I have been debugging one of my SL application developed in Win 7 VS2010 environment.  It was running fine in one of my colleague’s PC but it wasn’t working on my PC. That application was using a dll which does some cryptic work, I was able to locate the dll’s project and add it to SL solution so that I can debug into the project to see where it is failing. After some poking around, I found out that the program was reading HKLM\Software\Product key to get some data. I double checked my registry and the data exists so I ran again it still failed. The failure is not on reading the registry but the data from the registry which is used down the logic path. I double checked the key to make sure I am using the right key and it was right.

As would any normal programmer do next, I decided to change the value of the registry and see if it picks up the new value, to my surprise, the program did not pick up the new value.

With a couple of Google search I found out that, even if you pass the HKLM\Software\Product, when you run in 64 bit application, the program indeed was looking for HKLM\Software\Wow6432Node\Product. With that information, I changed the value in 64 bit registry entry and there is it, it picked up the correct value.

So just remember, if you are running a 64 bit application and even if you pass HKLM\Software\Product, the application will look for HKLM\Software\WOW6432Node.

Monday, 10 January 2011

Make Bootable USB Flash Drive

How To Boot From A USB Flash Drive
For starters this is still a new science and many people have had good luck with at least one of these methods. Note that flash drives are often also called thumb drives, keychain drives, pendrives, etc. The NEWEST methods are listed last on this page, starting with Method 6 for Vista/Win7
 
A FEW THINGS YOU NEED TO CONSIDER IN ADVANCE.
 
  1. The PC has to support booting from a USB flash/pen/key drive. There may be anywhere from 1-3 items to change in the BIOS to make this possible assuming your BIOS supports it. Some bios's may refer to your flash drive as a USB floppy or USB zip. Of course there are exceptions, perhaps some are covered here.
  2. The USB flash drive must support booting from it in general.
  3. The flash drive must contain the boot/system files.
  4. The flash drive must have bootsector area. This is done with special utilities.
  5. References to "A:" drive lines in the autoexec.bat and/or config.sys files you copy to the drive after you make it bootable may result in errors.
  6. You "may" have to format your floppy disk first in WinXP before you create a bootdisk as XP may "not" like working later on with a disk formatted otherwise.
  7. Included below is a bootable ISO of DOS 7.1 which may be used with some of these methods if you do not have a 1.44 drive.


METHODS
Method 1 - Make your flash drive bootable using Bart's mkbt util:
http://www.nu2.nu/mkbt/ | Alt: mkbt20.zip
Put a bootable floppy disk in your A: drive or create one using Windows.
Download mkbt20.zip and unpack to to new temp folder you create.
Go to the temp folder.
Extract the bootsector from the bootable floppy disk. eg Open a DOS Window and go to the directory where you extracted MKBT. Type:
mkbt -c a: bootsect.bin
The boot sectors from the bootable floppy disk have just been saved to a file in the temp folder you created.
Format the flash drive in FAT or FAT16.
Copy the bootsector to the flash drive. Open a DOS Window and go to the folder where you extracted MKBT. Type:
mkbt -x bootsect.bin Z:
"Z" represents the flash drive drive Letter. So if your flash drive has another drive letter, then change the "Z" accordingly.
Now you can [grin] "should" be able to copy the utils you need to the pen drive.


Method 2 - Try these 2 USB Flash Drive Utilities by HP/Compaq. They work with Most other brands of flash drives as well.
hpflash2.zip HP USB Disk Storage Format Tool. Formerly called hpflash1.zip
HP Drive Key Boot Utility Version 7.41
Download
"I would put a little extra in there." Says a fan who emailed me with no name:)
For the downloads section I use nLite to make and create the image file as you can import the service packs and do some tweaking to the install files.
http://www.nliteos.com/download.html
  1. Install the HP USB Disk Storage Format Tool and run the program.
  2. Select the Device and the File system from the drop down menus and click start.
  3. Close the above program and install and run the HP Drive Key Boot Utility. Selecting the appropriate drive letter. Click Next.
  4. Select the circle on the top that says create New or Replace Existing Configuration. Click Next.
  5. Select the circle labeled Hard Drive. Click Next.
  6. Select Create New Filesystem. Click Next.
  7. Select the circle labeled HP Firmware Flash Package. Click Next.
  8. Click Finish


Method 3 - Third Party Links
Boot off USB by floppy, CD, or NT boot menu when your computer doesn't support it
"I use it to boot off of USB by floppy when the computer doesn't support it - although in this mode it cannot save changes made to the setup." said Josh.


Method 4 -
Here is my another method for creating dos bootable USB sticks using windows format.
1. From Win98 DOS-Prompt type "SYS {USBDriveLetter}:" or "FORMAT {USBDriveLetter} /U /S". If from WinXp then from start->run command.com execute format.exe copied from win95 or win98.
OR
2. Simply by enabling copy system files in windows explorer format window. By default it is disabled for non-floppy drives. To enable it use windows enabler program from http://www.angelfire.com/falcon/speedload/Enabler.htm an whoila it works.


Method 5 -
First if you don't have a physical floppy drive (and don't want one) you can use the [free] "virtual floppy driver" from here:
http://chitchat.at.infoseek.co.jp/vmware/vfd.html
With that you get an A: drive and can manipulate a floppy image as if you were using real floppy. You can then use that image to make a bootable CD. It's not that user friendly but once you get how it works it does work perfectly.
Even cooler you can use a "raw write" utility like dd for windows to write the floppy image directly to your USB thumb drive. Even without that famous HP utility to do the magic this will make your USB thumb drive bootable. The 'dd' ported to Windows is located here:
http://www.chrysocome.net/dd
Another trick you can use with that dd utility involves MS VritualPC (which is free). You can create a virtual machine/virtual hard drive, set it up the way you want then use dd to "raw write" the virtual hard drive image to the thumb drive; this will make the thumb drive identical to the image, including bootable (again, no HP utilities required).
Of course, your thumb drive will effectively have the capacity the size if the image in question (your 1GB flash drive will effectively be 1.44 Megs).


 
Below are the methods for the latest OS Vista/Win7
 
Method 6 -
http://kmwoley.com/blog/?p=345
bootable USB guide, here we assume that you are using either Vista or Windows 7 to create a bootable USB.
1. Insert your USB (4GB+ preferable) stick to the system and backup all the data from the USB as we are going to format the USB to make it as bootable.
2. Open elevated Command Prompt. To do this, type in CMD in Start menu search field and hit Ctrl + Shift + Enter. Alternatively, navigate to Start > All programs >Accessories > right click on Command Prompt and select run as administrator.
3. When the Command Prompt opens, enter the following command:
DISKPART and hit enter.
LIST DISK and hit enter.
Once you enter the LIST DISK command, it will show the disk number of your USB drive. In the below image my USB drive disk no is Disk 1.
4. In this step you need to enter all the below commands one by one and hit enter. As these commands are self explanatory, you can easily guess what these commands do.
SELECT DISK 1 (Replace DISK 1 with your disk number)
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS
(Format process may take few seconds)
ASSIGN
EXIT
Don’t close the command prompt as we need to execute one more command at the next step. Just minimize it.
5. Insert your Windows DVD in the optical drive and note down the drive letter of the optical drive and USB media. Here I use “D” as my optical (DVD) drive letter and “G” as my USB drive letter.
6. Go back to command prompt and execute the following commands:
6.1. Change directory to the DVD’s boot directory where bootsect lives:
d:
cd d:\boot
6.2. Use bootsect to set the USB as a bootable NTFS drive prepared for a Vista/7 image. I’m assuming that your USB flash drive has been labeled disk G:\ by the computer:
bootsect /nt60 g:
(Where “G” is your USB drive letter)
7. Copy Windows DVD contents to USB.
You are done with your bootable USB. You can now use this bootable USB as bootable DVD on any computer that comes with USB boot feature (most of the current motherboards support this feature).
Note that this bootable USB guide will not work if you are trying to make a bootable USB on XP computer.


Method 7 - 
 Boot-USB-Stick
While trying to flash my bios I looked at your page. Most methods are complicated, after a while of browsing the net I found above:


Method 8 - Suggested by Kevin Ying: UNetbootin


Method 9 - Suggested by Shep................: WinToFlash


BareBones Boot Floppy And ISO
DOS 7.10 | Readme

Saturday, 20 November 2010

Why can’t we Create a Folder by name CON

While browsing through the orkut community, I came across the discussion that folder can’t be name as Con. Then I started googling about Con and got some cool solution to it.
Also read this amazing fact:-
An Indian discovered that nobody can’t create a FOLDER anywhere named as “con“. This is something pretty cool….and unbelievable . At Microsoft the whole Team, including Bill Gates, couldn’t answer why this happened!!!
Source-lists.evolt.org
I am sure that many people still don’t know that they can’t create a Con folder in windows XP and in some other Operating System.
So Why cannot we create a folder by a name Con? What’s the reason behind it?
It’s pretty simple, Con is a reserved name from the early days from DOS, it stands for the “CONSOLE” I/O device, Since it is already used by the system. If we create one with some evil tricks then the system will get confused. There will be an ambiguity.
Check out other reserved words to understand what are all the reserved words using which you can’t create folders in windows.
Like Con, many other reserve words are there which we can’t create. They are
PRN – It stands for printer.
AUX – It stands for Auxiliary device.
COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9 – They stands for serial ports.
LPT1, LPT2, PRN – They stands for Parallel ports.
NUL - It stands for Bid Bucket.
Did I said that the Con folder can’t be created, what a big typo. Well friends, There’s a evil trick to create a Con folder. Here goes the evil tricks.
Open the Command prompt by Start->Run and type in cmd
Type MD\\.\\C:\CON
C is the drive path, you can change this drive to your own choice of path.
Now Open My Computer and browse through the path where you created the Con folder. surprising huh!!! yeah buddy, you have successfully created a Con folder.
Now try to delete the folder, it won’t get deleted by simple delete option. Better try this:-
To delete the folder, type RD\\.C:\CON
Another method to create Con folder without the use of the Dos.
Create a new folder. Name it Con and press Alt + 255 simultaneously.
Well Alt+255 stands for a blank character in ASCII so it allows you to use this folder name.
Note:- Actually you’ll have to press the number’s of the number pad or else it won’t work. That is, create a new folder, rename it Con but don’t press enter yet. Hold down Alt and type 255 on the number pad and then press enter. (for laptop users, press Fn key and press the letter keys k-i-i to make use of number pad).
The next time when someone asks the question that why can’t we create a folder by name Con, say with confidence that it is not true…

Sunday, 25 January 2009

How to disable auto-start applications on windows startup?

Hi friends,
It may be frustrating, if it takes time to start up your computer. The reason behind is that many applications or programs loads automatically when the computer starts. I obviously donâۉ„¢t like this applications because it delays the startup of my computer. So i disable most of the auto-start applications except the anti-virus application.
So by using this tip, you can minimize the startup time of windows XP and Vista. You can disable some Windows optional applications which you rarely use like windows messenger, yahoo messenger, Quick time, Sound Man and many other auto-start up programs that run automatically when you start your computer.
Follow the given steps to disable the windows auto-startup applications:
To use this features, you will need to be logged into your computer with administrative rights.
Click start button and type msconfig in Run option then hit Enter for next.
The pictures are taken from Windows XP
msconfig, auto-startup, windows XP statrp-up, windows XP msconfig


A small System Configuration Utility dialog box will appear with many options like General, System.ini, Win.ini, Boot.ini, Services and Startup.
Now Select Startup tab and uncheck the applications that you want to disable from windows startup.

startup, auto-startup, windows start-up, windows XP startup, msconfig, windows XP msconfig

Now click on Apply button to implement the changes then click on OK button to end the configuration process.
Again close the all programs and restart your computer after any changes to go into effect.

Thursday, 17 May 2007

Keyboard Shortcut Keys for Windows XP & Windows Vista

microsoft.jpgA keyboard shortcut (also known as a shortcut, accelerator key, hot key, or mnemonic) is a key or set of keys that performs a predefined function. You can act faster, save time and reduce a lot of mouse work for some common computing chores using shortcut keys. Having said that, many people do not really like to use shortcut keys because it is hard to remember and find them.
Microsoft has summarized dozens of shortcut keys for Windows XP and Windows Vista users. If you are interested in being familiar with these keys, you can go to the relevant pages:

a. Windows XP go here
b. Windows Vista go here.