The company I work for has some KPI's regarding the usage of software. There is a distinction between so called white list and black list software. White implies good software. Software that is compliant with a list the company has given clearance to work with. Software that is listed as black is banned – the rest including a lot of stuff I like to work with is listed as gray software.

So what do you do if you want to work with cool stuff like Gimp, Inkscape, Texter, Executor, KeyPass and more but you don't want to ruin your and your boss's KPI

As long as your company does not block the USB ports of your computer there is an easy fix solution.

Just install portable apps on your personal memory stick and check for your favorite software available as a pa package.

After a certain time of working with the stick you will find it boring to start the stuff up manually every day. There's an easy fix for that one too. Just write some lines of code on a batch script (see sample batch script on the right) and move the stuff in your auto start folder and place a shortcut on your desktop.

@echo off

rem Start my portable applications

set dir=D:\PortableApps\

echo dir is '%dir%'

start %dir%totalcmd\TOTALCMD.EXE

start %dir%Texter\texter.exe

start %dir%Executor\Executor.exe

start %dir%FirefoxPortable\FirefoxPortable.exe

exit

 

After some more days you will be embarrassed by the fact that you have to stop the programs to safely remove the memory stick as it takes at least 30 seconds to niffle a around with the mouse and the touchpad. If you have to do this procedure more than once a day it's some kind of a time killer.

 

Next step was to create a little batch script that turns all your portable apps down at once.

So far it works fine to me. I just wondered why I always have to search for this 'Safely remove hardware' button. From Linux I am used to go to the hardware symbol and disconnect it – works much faster.

There is indeed a way to 'Safely remove hardware' with Microsoft Windows'.

@echo off

rem Stop my portable applications

TSKILL TOTALCMD

TSKILL texter

TSKILL Executor

TSKILL firefoxd

exit

 

Microsoft provides a tool called DevCon – strange name - reminds me of some alerted state during war. Anyway this little tool can easily be installed as a simple .exe file and is manipulatable over the command line letting you do some neat things with your additional hardware.

To use the tool for our memory stick sample we first have to find out under which unique address our stick is running:

Just  go to your command line and type in:

 

Microsoft Windows XP [Version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.

 

C:\Data\Profiles\A389939\Desktop>devcon listclass usb

Listing 19 device(s) for setup class "USB" (Universal Serial Bus controllers).

PCI\VEN_8086&DEV_2934&SUBSYS_20F017AA&REV_03\3&B1BFB68&0&E8 : Intel(R) ICH9 Fami

ly USB Universal Host Controller - 2934

PCI\VEN_8086&DEV_2935&SUBSYS_20F017AA&REV_03\3&B1BFB68&0&E9 : Intel(R) ICH9 Fami

ly USB Universal Host Controller - 2935

PCI\VEN_8086&DEV_293C&SUBSYS_20F117AA&REV_03\3&B1BFB68&0&D7 : Intel(R) ICH9 Fami

ly USB2 Enhanced Host Controller - 293C

USB\ROOT_HUB\4&1071008&0                                    : USB Root Hub

USB\ROOT_HUB\4&1557B86&0                                    : USB Root Hub

USB\ROOT_HUB20\4&81A9F9D&0                                  : USB Root Hub

USB\VID_04B3&PID_4485\5&36CF88F1&0&5                        : Generic USB Hub

USB\VID_058F&PID_6387\CF9ZR2OC                              : USB Mass Storage Device

USB\VID_17EF&PID_1004\SN0001                                : USB Composite Device

 

C:\Data\Profiles\A389939\Desktop>

 

In the above listing you see the USB Mass Storage Device with its identifiers. The line marked red returns the value we are interested in. Just take the first identifier from this line and add it as parameter for the devcon script.

Please take notice that I added a line with the command 'pause'. This being because it takes some time to remove any semaphores on the programs you excecuted. I give the whole process a little time and then press 'any key' to finish the job.

@echo off

rem Stop my portable applications

TSKILL TOTALCMD

TSKILL texter

TSKILL Executor

TSKILL firefoxd

pause

C:\Util\devcon remove @usb\VID_058F*

exit

 

That's it – I save quite some time with this little scripts. So with very limited effort you can raise your personal productivity!

For the devcon utility you find quite a lot of information on the web:

http://support.microsoft.com/kb/311272/en

 

Have fun with your portable apps.

 

In case of questions just contact me at gisler@gginfo.com.

 

 

Gregor Gisler-Merz, 7.12.2009

 

View Gregor Gisler-Merz's LinkedIn profileView Gregor Gisler-Merz's profile