NetSH scripting
I have been playing with two windows cli’s lately the first is the NetSH command which ships with everything from Windows 2000 on up. Will write up a post once I am more comfortable with wmic.
The main purpose of the tool is for network administration using the command line. The first thing I thought of was “YAY a way to change my IP for where I am” and that was how the batch file started. Yes I do know there are better scripting languages around, but I went with something that should work on whatever Windows 2000+ operating system it gets dumped in.
In my quest to manage my NIC’s from a script I came across another excellent Windows administration tool DEVCON which is what I used to Dis/Enable the network cards.
Dis/Enabling Network Cards
Controlling the state of the network cards was really easy once I found out about DevCon. I just extracted the files in the DevCon zip file into a place in my Windows path statement, then you run the command with the Device ID like below. You will need to replace the ID (in italics) with the one for you network card. You can find this by opening Device Manager, open the properties of the device you want to control. The Device ID can be found under the Details tab. If anyone know how to get the Device ID using DevCon I am sure it will be appreciated in the comments.
devcon disable PCI\VEN_168C&DEV_0024&SUBSYS_0087106B&REV_01\4&139D1158&0&00E4
devcon enable PCI\VEN_168C&DEV_0024&SUBSYS_0087106B&REV_01\4&139D1158&0&00E4
Getting some IP information
To show the ip configuration for all active network devices use
NETSH INTERFACE IP SHOW CONFIG
To only show a network you can add “Local Area Connection” or “Wireless Network Connection” to the end of the command.
Set the IP on a Network
NETSH INTERFACE IP SET ADDRESS “Local Area Connection” STATIC 192.168.0.36 255.255.255.0
NETSH INTERFACE IP SET ADDRESS “Wireless Network Connection” STATIC 192.168.0.36 255.255.255.0
This command is fairly self explanatory, replace the IP with what ever is applicable. In my script I have an item that allows you to enter your own address which makes changing to a unusual (read seldom used) IP really easy. You can always add more items if you need them.
Of course you can also set the interface to use DHCP
NETSH INTERFACE IP SET ADDRESS “Local Area Connection” DHCP
NETSH INTERFACE IP SET ADDRESS “Wireless Network Connection” DHCP
To add DNS entries you can use
netsh interface ip set dns name=”Local Area Connection” 192.168.1.230
If you need more DNS entries you would use the following syntax
netsh interface ip add dns name=”Local Area Connection” 192.168.1.231
Links – Further Reading
- Microsoft – How to Use the Netsh.exe Tool and Command-Line Switches
- Microsoft – DevCon the command-line utility, an alternative to Device Manager
Files

netsh scripting by Kim Alan White is licensed under a Creative Commons Attribution-Share Alike 2.5 South Africa License
Google Friend connect
Been playing with Googles Friend connect on the blog today, added the wall gadget to posts as an alternative to the standard comment system, really hoping it works better.
Must say props to the Goog for making something simple and easy yet again, especially when compared to Facebook connect.
Upgrade to WordPress 2.7
Just finished upgrading to the latest and at least this time the theme stayed in tact, well done to the WordPress devs for their hard work and Keith Dsouza for his WordPress Automatic Upgrade.
p.s. Love the new admin Dashboard, things are so much easier to access
Another how to keep yourself safe on the internet post :-P
With the latest phishing scam going around, in South Africa at least, I have written up this post to get my opinion on keeping yourself safe from the scammer. The title of the phishing mail that prompted this is “CNN.com Daily Top 10” from “Daily Top 10”. It caught me at first until I relised this was received on the wrong account as I have a sub to a similar service. All the links in the mail go to a fake CNN site that says you need to download their video player, this video player contains a key logger than will send all keystrokes you make to another party that will probably use it for their own gain. I must say that every time I have tried the site linked it appeared to have been taken down.
There are a few important rules to using the internet, and they apply to many other forms of communication: There are a few important rules to using the internet:
- If it seems too good to be true, then it is most likely is!
- If you receive email asking for personal or financial information, delete it! They already have your information, and if they really need your information they will probably do it through more personal contact.
- Never give out your personal information to anyone, they can and possibly will use it to impersonate you. (more…)
Food Portion Size, 20 Years Ago vs. Today
A visual representation of what sizes used to be (20 years ago) compared to what they are today.
I really wish some days that I could get a 32ounce cuppa Jo here in “Sunny” South Africa
Benchmark PGP versus Truecrypt Full Disk Encryption
I noticed something rather important missing in the realm of Full Disk Encryption, and that was benchmark data. The methodology I followed may be a bit unorthodox but would provide me with a consistant platform to test with.
I installed Windows XP SP2 on VMWare Fusion and applied all the patches available from our WSUS server. After installing the Benchmark application I created a SnapShot so that I could revert to the original install everytime with no deviations in installation, i.e. I was lazy.
I only encountered one major problem with running the Disk benchmark on PC Mark 04 when using TwoFish/RIPEMD160 encryption in TrueCrypt the entire benchmark would come up with the useless Windows Has Encountered a Problem message.
(more…)
Flip your blog
This is probably one of the strangest ideas I have ever used, try it yourself at http://www.revfad.com/flip.html
Here it is flipped
l????d?l?/?o??p?????????//:d??? ?? ?l?s?no? ?? ??? ‘p?sn ???? ???? ? s??p? ?s??u???s ??? ?o ?uo ?lq?qo?d s? s???
EDIT: OMFG, doesn’t work here. Oh well, I tried :-O

