BGInfo – Script for Local IP, Public IP and ISP Name

I recently created 3 scripts for BGInfo … If you need it, use it ;)

Local IP.vbs

I found this script at ardamis.com and adapted to my needs. I removed VMware local IP, because I don’t need it

strMsg = ""
strComputer = "."
 
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress,description from Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'")
 
For Each IPConfig in IPConfigSet
	If Not IsNull(IPConfig.IPAddress) Then
	For i = LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
		If Not Instr(IPConfig.IPAddress(i), ":") > 0 Then
			If InStr(1, IPConfig.description(i), "VMware") = 0 Then
				strMsg = strMsg & IPConfig.IPAddress(i)
				If i > 0 Then
					strMsg = strMsg & vbcrlf & VBTab
				End If
			End If
		End If
	Next
	End If
Next
Echo strMsg

Public IP.vbs

Based on script from howtogeek.com
I’m retrieving my public IP from ipify.org

Dim o
Set o = CreateObject("MSXML2.XMLHTTP")
o.open "GET", "https://api.ipify.org", False
o.send
echo o.responseText

ISP Name.vbs

I’m using whoismyisp.org for this task

Set o = CreateObject("MSXML2.XMLHTTP")
o.open "GET", "https://www.whoismyisp.org", False
o.send
strid = o.responseText
Set myRegExp = New RegExp
With myRegExp
	.Pattern = "< p class=""isp"">(.*)< / p >" 'remove spaces before use :)
	.IgnoreCase = False
	.Global = False
End With
Set myMatches = myRegExp.Execute(strid)
 
Echo myMatches.Item(0).SubMatches(0)

IMPORTANT:
Because my regex contain HTML tags I added space between < and p. If you want to use my script remove this spaces!

Connectify Hotspot 2015

I was on vacation in Germany and as usually I carried my laptop, smartphone, iPad and other “Wi-Fi devices” with me…

When we arrived in hotel I asked for Wi-Fi access. They asked me for how many devices and I said that for 6 devices. After a while I received 6 tickets with 6 username/password… all different. I went to my room where I started connecting all devices to the hotel WiFi…

My phone and laptop connected without any problems, my wife phone couldn’t connect at all… in that moment I decided to check if is possible to share laptop internet with other devices and I found this simple, but powerful application… Connectify Hotspot … I instaled it, run it and in a few simple steps I configured it…

c3

After that, I connected all my devices to Wolfy-AP and everything works without problems. And the best thing off all… when I moved to the next hotel I asked only 1 ticket for WiFi, connected my laptop on hotel WiFi and without any other configuration all my other devices had internet connection, because they were already connected to my Wolfy-AP!

c2

I could write all features that comes with this great app, but I think that if you find that app useful, you will go on there homepage and get all information there…

I bought  Hotspot MAX version, witch have all features, but they have other version…

c4

The free version is good enough for travelers, but when you see how many problems go away with this app, you will probably decided to buy a licence just for support the developers even if you don’t need any other features :)

For aditional info go to www.connectify.me.

Do you already use connectify hotspot? Share your opinion with a comment :)

Cisco VPN client on Windows 8

I recently installed Cisco VPN client on Windows 8. Everything was OK until I tried to connect, than I was getting  this:

Error 442: Failed to Enable Virtual Adapter

To fix this you need to do this :

  1. Open Registry editor (Win + R, type “regedit”, return or run)
  2. Browse to the Registry Key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\CVirtA
  3. Select the DisplayName to modify
  4. Remove the leading characters from the value data upto “%;”
    • For x86 something like @oem8.inf,%CVirtA_Desc%;Cisco Systems VPN Adapter”
    • For x64 something like @oem8.inf,%CVirtA_Desc%;Cisco Systems VPN Adapter for 64-bit Windows”
  5. Try connecting again

I found the solution here.

Free (SSD) disk space on Windows machine

Having a SSD drive is a good thing when we talk about performance, but when we talk about disk space we always want more :) To free some disk space you can:

Run “Disc Cleanup”

Disk Cleanup Running Disc Cleanup will free max 2-3GB of space. This will help you, but won’t solve low disk space problems… After a while this file will be back again and we will need to do the cleanup again and again…

Uninstall unused applications

Uninstall applications Uninstall unused applications is always a good idea. Doing this you will probably gain some free space, possibly you will speed up your PC too.

Turn off/Minimize System Protection

System Protection If you use any other system backup tool you can turn Windows System protection off, otherwise you can set max disk usage for system restore points.

Hibernation and Virtual Memory

If we have a large amount of installed RAM, we should take care of this 2 files:

  • hiberfil.sys
  • pagefile.sys

Each of this 2 files size is the same as the amount of installed RAM.

What is hiberfil.sys file?

From Microsoft Support:

The Hiberfil.sys hidden system file is located in the root folder of the drive where the operating system is installed. The Windows Kernel Power Manager reserves this file when you install Windows. The size of this file is approximately equal to how much random access memory (RAM) is installed on the computer.

If we don’t use hibernation we can remove this file. To do this we need to disable hibernation. This can be easily done with this command in command line (as Administrator):

powercfg -h off

If you want to re-enable hibernation again just run:

powercfg -h on

What is pagefile.sys file?

Again, from Microsoft Support:

RAM is a limited resource, whereas for most practical purposes, virtual memory is unlimited. There can be many processes, and each process has its own 2 GB of private virtual address space. When the memory being used by all the existing processes exceeds the available RAM, the operating system moves pages (4-KB pieces) of one or more virtual address spaces to the computer’s hard disk. This frees that RAM frame for other uses. In Windows systems, these “paged out” pages are stored in one or more files (Pagefile.sys files) in the root of a partition.

We can manualy set the size of pagefile.sys file or we can disable it. To do this:

  • Right click on “Computer
  • Click on “Properties
  • Click on “Advanced system settings
  • Under “Performance” click on button “Settings…
  • Select “Advanced” tab
  • Under “Virtual Memory” click on button “Change…
  • Change the file size or disable it and click on button “Set

Virtual Memory