Recently I have been working on a project that involves extracting a bunch of files from zips. The problem I faced was all the shortcuts within the zips were hard coded to locations, making it impossible for me to move the extracted zip data to wherever I may want. I wanted a native library that could read and modify Windows Shortcuts so I could drop my zip data anywhere; my project is in Java, and its instant cross compatibility was needed. I know all my clients have Java installed, so that made its dependency not a issue. After looking around on the internet and finding several options, including the popular https://github.com/jimmc/jshortcut. Now the downside the this popular jShortcut library is you need a DLL, why you need a DLL to write a binary file, I am not sure. More specifically, you need a DLL for your PCs instruction set, ick! After searching the far reaches of github, and getting to the end of my rope I found https://github.com/kactech/jshortcut, written 5 years ago, and not really popular on github I thought I would give it a try. IT’S AMAZING! With no dependencies, and just a single include, you can write, modify, and create new Windows Shortcuts! There is example code included, and it couldn’t be easier to use. I just wanted to make sure anyone who has had the same problem knows about this great library.
If you have been writing web apps for a while, or other apps you more than likely have used SQL. SQL allows you to query a database and interact with your applications data. Instead of trying to find a users profile, what if we wanted to find out what a user was printing on their local machine? If there was an easy interface for that, it could make programming for a platform like Windows a lot easier. Well Microsoft years ago added this ability to Windows; the technology is called WQL. This was added with the other components of WMI (Windows Management Instrumentation) at Windows ME. For Windows 9x and NT you can download the WMI core. This article will be a brief over view of what it can do and how you can play around with it.
First like when we looked at LDAP, we want a tool that will let us quickly play around with what is available, and then code that into our application. The tool I use is WMI Explorer, http://www.ks-soft.net/hostmon.eng/wmi/, it provides a easy interface to look at all the data available. With the WMI core it works with everything back to Windows 95! You can download and run the program for free, no installation required. Once open, there is a upper portion of the window that lists all the spaces you can access, these would be the ‘tables’ in SQL. Depending on your version of Windows, there will be separate options available. I have used this interface before for network cards (6to4 Cleaner) and printers.
For this example I will go over to the Win32 framework and access the Win32_Printer ‘table’. I get a list of printers the machine has installed, as well as attributes to each of these printers. Any administrator, or any program attempting to manager printers (I say attempting because printers can he a horrible experience) information – like what port the printer is using – is here, in addition what type of connection this machine has to the printer. At the bottom of the Window there is a Query that is building as you select different fields. This query can be moved into a application later to get the same data in code. WMI Explorer also allows for a user to write Queries directly without this interface; that is the second tab at the top of the window.
One downside I have found in using WMI is the setup process time, in C#/.NET using WMI is easy, but it takes time to start accepting queries. About a year or two ago I was working on querying network card information on Windows Vista. The first call could take a few seconds to respond, after that first call it would speed up, this is just something that has to be accounted for in the applications design. I found running WQL queries in a separate process, and starting them as soon as possible would allow the process to finish before the user needed the data.
I just wanted to get everyone started looking at what is available, in a later article I will go into more depth about programming with this and how you can interact with this data in a C#/.NET program.
Windows 8 is just around the corner, and I have been using it for a few weeks. Most people look at it and don’t to try the new interface; but after using it for a while, I find that I am faster, and that my computer is faster on it. The Task Manager is much better for those who want to use it, you can get all data at a glance, and drill down to what apps are using which resources. I was told that if you have a screen under about 1300×700 then you can’t do the split screen action that larger machines can. Office 2013 preview is out, it allows users to install office over the internet in about 20 minutes, but it is usable in about 2. This is useful when setting up a new computer.
I was forced to reinstall my laptop, Toshiba Portege Z835-P330, the settings that the built in metro apps had automatically came back. Going back to the Windows Store and telling it to reinstall all the apps I had earlier in Metro was seamless. All the apps that were install in the desktop, including chrome, which bleeds over to metro, has to be reinstalled manually. The year is 2012, and by using Dropbox/Google Drive and logging into chrome reinstalling was painless.
The last note I want to make is that I ran into a weird Toshiba software bug, my laptop has an Eco program that tells the user how much power the laptop is using to the watt. I tried to install it and got “Unsupported Bios”; you have to first install “The Toshiba Value Pack”, then that puts core Toshiba files in and all of a sudden the eco tool will work.
This version brings a few fixes and new features, hence the version jump. Features Include:
- Minimize to Tray when removal is working
- Checks if already running on startup
- Faster IPv6 detection for method 2
- Slightly smaller
Here is my latest little creation, CUFU, which stands for COM USB Finder Utility. The purpose is if you have to plug in and out a USB to COM port cable a lot and it changes which COM it is in windows, making you go to device manager, now you can run this, and hit the icon, and bam it will tell you. Right now it will tell you by default if “Prolific USB-to-Serial Comm Port” is plugged in, and which is the most recent. That can be changed, there is a updater. Its a standard one week project. Also I wanted art for the about page, “art” is stretching it for what I made.
Download (Requires .Net v2)
I have updated card cleaner to 1.51, new features include:
Backend Fixes Updater Displays server While removing cards, output
is correct Download:
This new version of 6to4 Card Cleaner adds the full Microsoft process of fixing the problem; the program will disable IPv6, remove the cards, and then run KB980486. There still is a option to just remove the cards. Added features also include an updater, a window that allows you to set IPv6 to any of the 6 settings, and a new backend.
These cards WILL NOT show up in device manager, unless you turn on hidden devices, and WILL NOT show up in ipconfig unless you do ipconfig /all.
I also took out the window that lets you change the IPv6 setting, and made it its own app, so if you need a user to just change IPv6 they can get this 70kb app.
As always any bugs please report them, I will patch and the automatic updater will alert users a new version is available. Source available on request.
Multiple versions of Windows, mostly Windows 7, support IPv6 networking, and if your network doesn’t support it, and the machine wants to link to a site or computer that does, it will make a virtual IPv6 to IPv4 converter card. Now sometimes Windows doesn’t reuse them, or delete them. So in this situation these cards keep being added to the system, adding and adding. Eventually the use will attempt to connect to a local server, or some other service, and Windows will try every card first, and then fail to connect. Timing out even though the real connection has no fault. It appears at around 180 virtual cards we start to see this. The solution is removing all the cards, but Windows wants you to remove them one at a time. Microsoft does have a tool for removing devices in a systematic order, but you need to get the one for your architecture, and some of these need you to download a large package and extract it. So I decided to make it simple, download and run my tool and it will remove these cards for the user. After the removal the user will need to reboot but then they can connect.
Now this doesn’t keep the computer from adding more cards in the future, and I don’t want to disable IPv6, for it is slowly rolling out and when the user actually gets it they should be able to use it. So the current release, v 1.2.2, has a few command line arguments, and will run in graphical mode if no arguments are presented. It is very simple, a few buttons that do their jobs. In the future I want to add a scheduler option, that will allow you to run it monthly automatically so if this problem persists it isn’t a pest, along with a updating function so no need to download a new version if installed.
The download link is below, it requires .Net 2.0, which is already installed on Windows Vista and Windows 7.