Map external drive to local folder

As mentioned before, I bought new desktop – and with new computer, there comes usually new challenges.

My new PC have built-in card reader – but as you know, if you have card reader with NO media inside, it will still occupy your drive letters and this can be quite confusing. Specially because I am using external USB drive and I am used that it is mapped to drive E: on my laptop – on desktop it is drive J:


So I decided to use some less known functionality of Windows – to map disks to local folders instead of drive letters. To achieve that, you have to follow these steps:

1.) Create some local folders – I created C:\Links (which is my storage of symlinks shortcuts) and there I created folder ExternalHDD

2.) Right click on Computer and select Manage

3.) Select Disk Management

4.) Right click on selected disk, select Change Drive Letters and Paths

5.) Remove current drive letter:


6.) Click on Add. Instead of specifying new drive letter select “Mount in the following empty NTFS folder” and specify folder you created in step 1:


7.) Click OK


Now you can check that your external HDD is no longer available through drive letter, but it is instead mapped to your local drive πŸ™‚

I also created C:\Links\CardReaders – and I am mapping all my (empty) card readers as folders (so SD will be SD, MMC will be MMC etc…) to better organize my stuff:


So here is after all my final picture from Computer:


I really like to use symlinks to organize my data and to make them easily accessible. Microsoft is also using symlinks – and this is one of examples where you can run into hidden implementation of symlinks.

UPDATE: Forgot to mention – it is NOT Windows Vista specific feature, it definitely works on Windows XP and probably on Windows 2000 (I am using this feature for looooooong time)

How to convert files online (…and for free)?

I am sure all of you encountered this – you need to change format of some files, but you dont want to install some software on your pc and spend lot of time because one customer cant read docx files (just quick example)?

Or you are on PC and you need to extract .rar archive (not by default supported by built-in zipper)?

I can recommend ZamZar, easy to use and functional file online converted.

Usage is pretty simple:

  1. Upload file or specify URL

  2. Select target format you want (so for example if you uploaded PDF just select DOC)

  3. Specify your email

  4. Click OK – file is uploaded, converted and you will receive it to your mailbox

Usage is pretty simple and it really works. What I really like is that it is not stick with 1 or 2 file types, it supports 54 πŸ™‚ Including formats like .mov (so you can easily change it to mpg) or as mentioned PDF that can be easily transformed to DOC. Or quite nice conversion from PPT to flash movie…

Try it yourself πŸ™‚

Application Virtualization presentation

I had presentation yesterday about application virtualization – I was talking about appvirt in general, then focusing on available solutions (SoftGrid, XenApp, Thinstall, SVS, AppStream, AppExpress, XenoCode….).

As mentioned in my previous post, I will try to immediately upload all presentations before I forget. So here it comes:

If you are interested in this topic, just leave some comments and I can write a little bit about it.

Useful tools for scripts

One of my favorites are from SST (Shell Scripting Toolkit) from Bill Stewart (, but I dont understand why they are not really known in community.

So I decided to post a little bit about them, maybe someone could be interested.

Toolkit contains following utilities:



Change Case – allows you to change case using pipe, pretty simple and sometimes can be VERY useful. Just pipe output through ccase you you get results you want:

C:\Temp\BillStewart>echo Testing cHAnGe Case | ccase -l
testing change case

C:\Temp\BillStewart>echo Testing cHAnGe Case | ccase -u


Do you want to use custom color scheme in your scripts? Or manipulate with it? ColorX allows you to detect current settings or change them.
If you use -l switch, ColorX generates really nice overview of available colors, so you can quickly choose your combination. For example I like to have specific color of output to stress some facts (for example Success is light green, failure is red and important messages are orange), so you immediately see if there is anything wrong. Problem is that many people change default color, for example using red foreground (so all errors and warnings got lost).

I can build simple workaround using ColorX:

:: Store original settings
For /f “UseBackQ tokens=*” %%c IN (`ColorX`) Do Set Settings.OriginalColor=%%c

:: Change to MY settings (white frontground, black background)
ColorX -c 0F

:: Do something….

::Restore original settings
ColorX -c %Settings.OriginalColor%


One of the biggest pains when handling with batches are date\time manipulation. Problem is that they are dependant on your regional settings and if you need to manipulate with multiple countries, scripts are getting VERY complex. Not to mention problems if you want to increase or decrease values – my script for getting (universal) file creation time is 90 lines long. You will also probably (sooner or later) discover some cave-eats of batches – for example batch Set /a behavior. For example you want to store date one month ago in variable. It starts pretty simply – you just parse %Date% variable or use Date/t.

Today is Thu 03/27/2008 – and you would like to run something like Set /a 03 – 1 (March – one month) and then have some check like If %Result% LSS 1 set /a %Result% + 12 (that is probably easiest method how to handle with months). Still not see problem? If you would implement it today, you script will work for 5 months – and 1st of August it will stop working. Because we see “03”, Set /a automatically consider number is octet – and 08 doesnt exist in octat, so you will receive error:
Invalid number.  Numeric constants are either decimal (17),
hexadecimal (0x11), or octal (021).

Well, to make long story short, just ignore batch functionality and use DateX instead. I am using DateX for two purposes – first one is for time comparison (here is it extremely useful) and also for predefining format I expect.

Example of time comparison:

For /f “usebackq tokens=*” %%x IN (`DateX -t`) Do Set Temp.Start=%%x

::Do something

For /f “usebackq tokens=*” %%x IN (`DateX -t`) Do Set Temp.End=%%x

Set /a Temp.Duration=%Temp.End% – %Temp.Start%

Echo Script was running for %Temp.Duration% seconds

Of course changing it to minutes\hours etc is not problem at all.


Allows you to manipulate with drive and retrieve type of drive. Only problem I encountered (but there is probably nothing that can be done to fix this) is that it is not able to detect substed drives (mapped using Subst). Returned errorlevel identifies drive type – so 3 is fixed, 5 is CD-ROM etc..

It is most usefull if you want to process particular drive types. For example unmap all network drive command is pretty simple using DriveX:
For /f “UseBackQ Tokens=*” %%d IN (`DriveX -l 4`) Do Net Use %%d: /Delete


EchoX is probably my favorite utility and I use it with most of my scripts. What it allows you to do? Its pretty simple, you can change color of output (not WHOLE console window, only one line). Also I really like usage of escape characters that allows you to include line feed and return commands in one line.

Consider scenario where something goes reaaaaally wrong – and you want to notify user. You want to display following message:

:: Do something

WARNING: Problem was detected when using script X.
WARNING: Script will now abort.
WARNING: Please contact your administrator

:: Do some recovery

Using  batches, you must write following “code”:

:: Do something

Echo WARNING: Problem was detected when using script X.
Echo WARNING: Script will now abort.
Echo WARNING: Please contact your administrator

:: Do some recovery

Which is not bad, problem is that same color is used and it is really easy to miss such important information. With EchoX you use

EchoX -c 0C “~nWARNING:Problem was detected when using script X.~nWARNING: Script will now abort.~nWARNING: Please contact your administrator~n”

Of course you can split it to three lines. What is important is that this message is obviously error. It is really nice if you use it together with If Else:

If /i #%Result%# EQU #OK# (
EchoX -c 0A “Operation finished successfully”
) Else (
EchoX -c 0C “WARNING: Something wrong happened”

That way you can change your batch script to appear more like utilities. Highly recommended, when I was searching for something like this I found SST. You can find (very few) tools that do the same, but all I tested had problems with buffer (text was truncated, sometimes corrupted etc)


FInfo allows you to dump some basic information about files. You specify file and you can get path only, file name etc. This functionality is not that important – you can achieve the same by implementing %~ (if you are interested, leave some comment and I can write how to use it).

What is more interesting is option to get last modification time in same format as DateX (universal, no parsing needed).
Also option to retrieve file size is really nice – output is obviously made for parsing (BTW Bill, if you read it, I cant stress enough how I appreciate parseable output ;)).


Not really useful today, because built-in If contains same functionality. Obviously it was build for 9x OSs, so dont expect anything really fancy here. It would be nice if it would contain features like IfX Starts With, IfX Ends With, IfX Contains etc…


Allows you to handle with output, generally Windows tails\head tools. Nice feature is that you can retrieve line n (so if your second line is always ::Created by, you can easily retrieve this). Usually you need to write some For /f with counter that tells you when to stop parsing – which is quite time consuming and not really reliable, so LineX can really help.


MS-DOS utility to store output in variable. Replaced in NT by For /f, I never had chance to try it.


Could be really nice πŸ™ You can shellescaped any text – which is really great if you automate automation like I do πŸ˜‰ Problem is that ScellEsc was never really working for me – when it encountered empty line, it always crashed with message

Runtime error 216 at $0040107F

I completely forgot about this tool and I will try to write Bill if he still supports SST and if he could fix it – because I like to organize my code to make it easily readable.


Nice replacement of original Sleep. While original sleep allows you to specify time only, SleepX allows you to display message also and add option (and this is why I like it) to abort sleep by any key. One feature I am missing is that I would like SleepX to sleep forever if no timeout is specified and option to abort was enabled. I know I could use Sleep & Pause combination, but the idea is that you could allow people to define timeouts for different messages like this and use one code for all configurations.


Str allows in general two operations – first one is to change to uppercase\lowercase  and echo number of characters in string. For upper\lower case I prefer to use CCase, because it accepts pipe, but number of characters is sometimes very useful (especially if you want to do something where limited characters are allows). Second functionality is to detect string inside string and return starting position. I prefer using Str to handling with Find (you can detect if string exists by checking errorlevel), also because it allows me to easily detect if string STARTS with different string (which is sometimes quite important).


Tee allows you to split output – so you can create log file that contains everything that is displayed to console. I like this concept, but prefer MTee to Tee because it contains more functionality.


This tool could be quite useful, but I am still using script to do this:

Set Temp.ID=%Random%
If Exist “%Folder.Root%\Cache\%Temp.ID%” Goto GenerateCacheFolder
Set Temp.Cache=%FolderRoot%\Cache\%Temp.ID%
MkDir “%Temp.Cache%”


Presentations for download

I am really messy with my presentations – I always forgot to keep copy of powerpoint slides and I found out yesterday that I only have 8-10 ppts available from my own presentations πŸ™

So I decided I will change it – I am creating new SkyDrive public folder and I will try to upload all (future) presentations there…

 BTW I really like SkyDrive – free for use, 5GB is enough for me, easy to use and to share…

Today I have presentation about Application Virtualization (comparison of all products, MAV, XenApp, Thinstall, SVS, Xenocode…), so I will try to upload it also


How to synchronize data between computers over Internet

Recently I wrote about my new shiny desktop (we all know that after few months it will be old junk ;))… I want to use this computer for work mostly, for developement, testing etc… For that reason, I would like to synchronize some data between different computers, ideally over internet (and also share some data with my colleagues\friends – for this I am using Live SkyDrive).

Microsoft recently aquired product called FolderShare, so I decided I will give it a try. And I must say I really like it. You install (small) application that is running on your PC and it is responsible for synchronizing all data.

 You can mark sync folder as private or you can share it with your friends… Nice thing is that you can also remotely browse your PCs harddrive.

Currently there are however still some problems:

– LiveID is not supported – I see this is definitely only temporary issue, but it is quite annoying (also because they have password complexity turned on, so I cant use same mail & password as is my original LiveID).

– No option to download whole folders from remote PCs (however you can download files). I understand this is not primary function of FolderShare, but I would definitely like to see it

– data limitations – of course, we always want more and more πŸ˜€ I know there is 10.000 files per-library limit, dont know about size limits

– automatic detection of proxy server – it is quite annoying to enable\disable proxy over and over again

– two-factor security would be nice… for sensitive data like this password is not really enough (but same applies for LiveID itself)

– public & password protected libraries would be nice. Public for projects (install FolderShare and all your projects (understand different utilities etc) are automatically up-to-date), password protected for load&wipe sharing.

Thats all… So far I highly recommend this tool – if you have few PCs and you want to synchronize some data…

Is Windows Vista really failure?

More and more articles are stating that Windows Vista is failure and reviewers all over internet are suggesting that Microsoft will soon end… After a while I decided I will try to collect all my thoughts and make my opinion public also πŸ™‚

To understand current situation with Windows Vista, we should look back at Windows 2000 and Windows XP. If you read reviews, most people are saying “XP is superior to Vista, why we should upgrade?”. But we shouldnt forget that Microsoft is not company that can build ad-hoc solutions for next 1-2 years. What I mean by this crypted sentence is that if you remember situation few years ago, everyone was saying that “Windows 2000 is much better than Windows XP, XP is just eye candy”. Why in that case we dont see people stating that “XP is superior to Vista, not talking about 2000 that is superior to XP”??

Reason is quite simple – what most people mean is “XP SP2 is superior to Vista”. Because XP was not really hit when it was released.

It took few years until everyone realized that XP is stable and everything works really nice.
It took few years for Microsoft to unleash the beast.

We are supposed to be IT professionals (depend YOUR job my reader, of course, but I am supposed to be IT professional ;)). I cant focus on today only, I must also look at future. And Vista is built on really GREAT core. How is it possible that Windows XP is still modern OS after those years? Because its success was based on lessons learned from Windows 2000. Windows Vista is based on lessons learned from Windows XP.

If you have a look at compains about Vista, they are mostly related to following: UAC, performance, hardware drivers, Aero… If you think something is missing, please comment, if I can post some useful reply, I will do so.


Implementation of UAC is not really user friendly – but we should consider that UAC is kind of backwards-compatibility fix. Have you noticed any applications that released new versions where UAC was not prompting user? I bet you did (at least I noticed many applications that are able to work with UAC now).

In few years we could see Vista in many companies (it really takes few years for companies to migrate to new OS, that is completely normal) and I am sure most vendors will modify their applications to be UAC compatible (which means to be able to run with limited user accounts). So UAC will be less and less problem in future.

Citation from Aaron Margosis(BTW Aaron works for Microsoft), talking about least user privilege principle: “Linux/Unix users have understood this for a long time, so this remains an area where Microsoft is perceived to lag in thought leadership.”  Another related bit of information from Technet magazine: “It’s a Bugβ€”Treat it Like One and Make the Developers Fix It!”.

I dont know about your experiences, but maybe most bugs we recently reported to our vendors were related to least-privilege principle. Currently developers are not forced to fix such issues – it works on most systems (due to local administrators accounts on XP), but with Vista spreading over world`s PCs we will see more and more software to be written in more correct way (talking about least privilege principle). And benefits of Vista will be more and more obvious.

And applications that will fail to migrate? Who is using (seriously) applications from Windows 95 or Windows 2000 today (if we ignore legacy apps)? In fact, Vista got advantage here – built-in isolation allows you to run applications that requires admin right under non-admin account (AIE, anyone?).

For me, UAC is pain – but it is something we needed for many, many years and it is result of some not really clever decisions Microsoft have done in past. But with Vista they are facing this issues – and UAC will be less and less important as time goes on and applications get adapted to it.


We have year 2008, hardware is moving forward. What always surprises me is that people expect new OS to perform better than previous one – I understand this if we speak about applications, but OS is implementing more and more features. Problem with Vista is that it is changing too much under hood – and performance suffers. If you noticed I bought new computer recently (not upgraded, due to fact that I only had laptop) and I had Vista preinstalled – and I must say that I didnt have any problems with performance. I want to run it for longer time first to see real affects (and turn off some features I dont really use like Indexing). But performance of Vista is NOT really bad – XP was faster, but it was older OS.

95 was faster than 98. 98 was faster that 2000. 2000 was faster than XP. And so we can continue, it is normal process in IT and I think it is same with OSX or Linuxes. Problem with Windows is that it comes with pre-installed applications and I can understand it (most normal users are complaining that Windows is too complex – make them install and configure software and they will return to their table calculators instead). From my perspective I would appreciate Vista Embedded to be broadly available, but it requires too high knowledge (lets say more robust and stable nLite supported by OS).

What was average hardware in 2001? Not really sure about this, I had AMD 700MHz with 128MB, 20GB (5400 RTM) HDD.
Today is 2008 and I have quad core with 4GB and 500GB HDD.

I would really love to install XP on mine old PC and see performance. BTW in 2001 I was using 98 – XP was too slow for me.

Compare numbers and think about lifecycle of OS – when it is released, when it can be used, when it have “best age”. Vista is not performing bad on my current PC.

Also dont forget that what you usually want is not performance of OS, but performance of applications – and current applications are not “designed for Windows Vista”, but rather “Compatible with Windows Vista”. I dont really care about CPU and graphics perfomance these days – I see biggest bottle-neck in memory (there is never enough memory ;)) and specially IO operations (disk reads and writes). Vista takes radically different approach in memory management compared with XP – best description I found is on (very good) Coding Horror blog. I dont want to waste my memory (otherwise I dont need it).

IO operations are extreme pain these days – specially on laptops with 5400 RTM disks. I was always big fan of prioritization – talking about CPU, network, everything. Not long time ago I started to control priorities on my notebook using Process Lasso (see my older post) and my first thought was “One day I want to have same for disk operations”. Vista supports prioritizing IO operations, now I just need to wait until more applications will support this (download managers, antiviruses or even better Disk Lasso to manage it yourself ;)).

You can even see importance of this when you study Windows Logo Program – there is difference between “Certified for Windows Vista” and “Works with Windows Vista” (as far as I remember, XP had only “Designed for Windows XP”). Hope so soon enough we will see more “Designed for Windows Vista” applications – not only with logo, but also with additional functionality πŸ˜‰

Hardware drivers

Always pain. Everything on my PC was working correctly (but it was shipped with Vista, so all hardware was compatible). During my beta testing of Vista I run into serious problems with hardware (specially with graphic card), but with final release all problems were gone. I am not sure if hardware drivers are still problems. Comments, anyone? πŸ™‚


If we want to talk about Aero, we must first make something clear – most of the time people are refering to Aero, they see it as eye candy with no additional functionality. Common interpretation is that Aero is like XP-themes, but more resource consuming (and shinier).

That interpretation is not correct. To understand Aero and its advantages, you should always think about Aero+DWM – because DWM (Desktop Window Manager) is beast, that was not yet unleashed. To understand (warning: following text will be short and partially inaccurate in order to make it easily readable. That doesnt mean it is fairy tale – it only means I will skip in-depth details), we should think how XP renders you desktop.

In XP, you desktop is one flat image. One desktop manager is responsible for drawing everything, applications are requesting to redraw their area. This is why you can see that when application stops responding, form is white – it is not responding, therefore it is not able to redraw its form. Different utilities that shows you thumbnails of your programs are therefore static – they show you only snapshot of window and it is quite resource consuming.

In Vista DWM situation is quite different and very similar to how OSX draws its desktop (which is good way). Applications do not write directly to video memory, but to off-screen buffers. These buffers are then composed by DWM to render your screen. Desktop in Vista is fullscreen Direct3D object with all advantages related to this. Composition is done by GPU – not by CPU anymore.

Read previous two sentences carefuly and think about them – what it means is that Vista allows cool visual tricks. Not windows flip (famous Winkey + Tab), not live previews.

Because of this change, there is much more space for applications like TaskSwitchXP – showing off-screen buffers doesnt cost almost any performance. Once you understand this, you can see that implementing Eclypse from OSX is really easy task – it was static in XP and can be dynamic in Vista (BTW many people are blaming Microsoft for ignoring Eclypse – Microsoft implemented same technology many years ago, but for some reason it is only available with Microsoft Hardware under name Instant Viewer). Consider terminal services manager like vRD – it can show you preview of all opened RDP session in one screen. Aero is just foundation – and we will get advantages once (again) we will get applications designed for Windows Vista. Really nice article is available at Ars.

These are my thoughts about Windows Vista – to summarize it:

Windows Vista is now in “compatibility period” – it just runs applications designed for Windows XP or even older operating system. If you think it have some advantages for you (definitely it have many for me), go for it and dont waste your time. If you think Windows XP is enough for you, wait for applications “Designed for Windows Vista” – but dont miss train and definitely dont judge new Windows too soon. Maybe we will see similar situation as with Linux few years ago – people disappointed by Windows started to evaluate different OS, but returned with XP SP2 afterwards (watch how popularity of Apple grows now ;)), this trend can be found if you try Google Trends I mentioned in previous blog post πŸ˜€ If you are aware of Windows XP limitations (in best case you are combination of IT Pro\Programmer\Hobbist), you can clearly see that Vista is providing solutions for most of them – but these solutions must be implemented on applications level.

Post comments please, I really appreciate them always πŸ™‚


Google Trends

I am always curious about which articles from my blog are most interesting for people… To my surprise no. 1 (for long time) is post about changing resolution from batch script.

I wanted to find some site or something with “Great list of unanswered technical questions”, but so far no luck… Just by accident I run into Google beta project called Google Trends – and I really like it πŸ™‚

 It allows you to search for query trend based on some words. For example if you specify Microsoft, it will show you how often people searched for this term in history together with some News extractions…

 You can also compare different search strings. For example specify Microsoft,Google and you will see trends in search queries (notice big google jump in 2005).

 I am not sure however how these results are if you try to specify more generic term. For example comparing Windows, Linux, Apple – are also results for “Windows Replacement” included? Or is New York results included for Apple results? πŸ˜‰ If results are accurate, it shows interesting trend, where less and less people are interesting in Linux and interest in Apple is growing (with Windows falling slowly).

That is quite hard to say… It you try specific query (as mentioned Microsoft + Google), you probably get good results… Interesting result is comparing Softgrid and Thinstall

 Also notice regions (and time span) below – this can be very interesting if countries want to find where are people intersted about their products. For example you can see that most people interested in Citrix are from Oslo, Amsterdam and Sydney


Specify default process priority and CPU affinity for some processes

Well, you already run into similar problem before – you have one process that you want (must) run at background all the time, but it is decreasing responsiveness of your whole system. So you assign it lower priority (Idle\Below Normal), but after reboot\process restart it have same priority again.. And same applies for CPU affinity – you would like to keep one core (we are talking about dual core systems) only for some processes that you want to keep highly responsive – you can do it, but specify it for all processes over and over again??

 That is too much pain.

On my system I have 87 processes running – most of them from “enterprise vital” products like Symantec or Altiris (well, now it is same company), these you really love to have many processes (Altiris is running 5 on mine, Symantec 11) and some of them can really destroy your day (Symantec auto update – it will run 3 (!) processes, all of them set to high priority\realtime).

So after little investigation (and writing few scripts) it turns out there is one utility already doing this and it is really nice – name is Process Lasso and you can find it here.

Process Lasso allows you to configure default values for processes – so everytime process with specified name runs, it will have predefined priority and affinity. I am only missing option to build rules not based on process name, but on Company name (Vendor) instead.

As “bonuses” you will get tons of additional features, for example foreground boosting (process that is in front will get priority boost) – I just turned this feature on few seconds ago, so dont have any personal experiences πŸ˜‰

Also if one process tries to get too much resources, his priority will be lowered – in fact same functionality as ThreadMaster on Citrix\Terminal Services (if you dont know it, download it immediately – it is for free and can same you lot of pain by preventing one user from crashing whole server).

New PC is coming – expect much more blogging activities :)

Heya guys,

 I try to keep this blog alive, but I am running in some problems with my home PC – I dont have any πŸ™

What it means is that I must use my official laptop for blogging – and that means no betas, no experiments, only stick with “normal” projects. Today I ordered my shiny new PC, so you can expect much more activity here in new future.

I would love to focus on Citrix AIE pretty soon – I was running some experiments recently and it turns out AIE is VERY good technology and I dont understand (well, I do, but it is due to bad implementation) why most people dont like AIE and dont trust this (really useful) technology a lot. So when my PC will arive, I will install some VMWare(s)\Xen(s)\Virtual Server(s) and run destructive tests to share with you πŸ™‚

Also I plan to release new version of GroupsOverview utility (with minor fixes\added features). One of new features should be ability to use it with Citrix – in GUI, you just select published icons you are interested in and you will see relationships to Active Directory groups. I consider this utility pretty useful and I use it quite often, how about you, have you tried it?

 Also I would like to create new (totally redesigned) version of AutoUpdate script with ability to share configuration – this utility is also quite useful for me, so I would really like to extend it in future. Out of new features, most interesting are ability to write post-download scripts (so you could for example automatically extract archived Sysinternals utilities to some folder), link-based downloads (so even utilities that doesnt have direct download site will work), automatic proxy detection and configuration (which is not possible now and if you have proxy at work you know that it can be pretty painful if you need to switch it on and off and on and off…) and unattended mode with reports (so you can schedule this check to run every hour).

 Next project I would like to work on is set of utilities for automating Citrix – tool for automatic generation of published icons, automatic assignment of load evaluators and tool for automatic creation of AIE (and rules if possible), but for this I need some time.

Also COMDetector should be extended – it should use resources in next release, so it should be much more robust and reliable (and without annoying message boxes finally).

Are there any other tools you are missing currently?

Talking about article, I would like to start writing reviews about some products that got my attention recently – mostly SBC related.