mercoledì 9 aprile 2014

Windows 7 8 hotspot

Hi,
if you want to create on your Windows 7/8 an hotspot for your mobile device read below:

1. check wifi
check that the pc wireless is running (did you switched on the wireless switch?, did you move to "on" the software switch in windows?)

2. check the drivers
open a CMD prompt AS ADMINISTRATOR, run this command to verify the wifi driver support hotspot :

netsh wlan show drivers

you'll see a lot of information, but you are interested in this line:

Hosted network supported  : Yes

if you have a "no" maybe you are using microsoft drivers from the OS, or an old driver from the manufacturer, so try to download the latest driver you can find for your wifi network card, install it, reboot and then check again if it turned to "yes". If you still see "no" maybe your network card simply DOESN'T SUPPORT creating hotspost, sorry, job finished.

3.create the hotspost network:
netsh wlan set hostednetwork mode=allow ssid=forandroid key=12345678

if you go in control panel , device manager, from menu view show hidden device, under network adapters section you should see something like

Microsoft Virtual WiFi Miniport Adapter
or
Microsoft Hosted Network Virtual Adapter

4. start it:
netsh wlan start hostednetwork

and if you open the "Control Panel\Network and Internet\Network Connections" from the control panel you should see the new virtual network card created, rename it something like "HotSpot" to better identify it

5. share the connection
now edit the properties for the network card that is connecting to internet on your pc (maybe the ethernet card, or a internet key etc), go to the sharing tab and select the "Allow other network users to connect through this computer internet connection"
from the dropdown menu select the hostednetwork adapter created before (the one renamed in point 4)

from now on you would be able to connect to the "forandroid" network using password "12345678".

From the next reboot the network should be still there, you would just need to start it with the last command

note:
in case in step 4 you see someting like
"The hosted network couldn't be started.."
double check the initial steps in this guide, probably you don't have the wifi turned on, or the driver is not supporting the hostednetwork

in internet there are other cases/soultion about this type of error, about power saving and other, give it a try

bye
Digger


lunedì 7 aprile 2014

VB.NET ESC button to close Form

It happened today that I was trying to close a form in a VB.NET application using the ESC key.
Usually if you have a Cancel button on the form or similar you can simply set the CancelButton property of the form to that button, but in my case I didn't have that button on the form nor I want to add one.

I tried using the KeyDown event, but, strange, pressing ESC or every other key didn't fire the event routine.

As I didn't have time to investigate and find out why it happened I preferred to search in internet for some easy and fast solution, I find one post from Adam Butler that worked,
it was in C# so I had to simply translate in VB.NET

here's the code to put in your form code to be closed:

Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean
        If (keyData = Keys.Escape) Then
            Me.Close()
            Return True
        End If

        Return MyBase.ProcessCmdKey(msg, keyData)
    End Function

giovedì 3 aprile 2014

BCDBOOT failure when attempting to copy boot files (and an operating system wasn't found

If you, like me, tried to deploy Windows8 (maybe for 7 is the same) using a wim image and then used the command

bcdboot c:\windows

and you got the message "failure when attempting to copy boot files" probably you are in the situation I was.
I tried to solve using this command:

bcdboot c:\windows /s s:

(where S: is the small system partition) and apparently with success, but after rebooting the machine you got:

An operating system wasn't found. Try disconnecting any drives that don't contain any operating system.

after many unsuccesful test and many investigation, I arrived to the conclusion the issue is related to the UEFI support of the machine (also if when starting, it appears to be a normal BIOS)

so I solved the issue with the command :

bcdboot c:\windows /s s: /f ALL

that ALL means copy both the BIOS and UEFI files to the disk

Remember S is the system partition, not the partition containing windows files