Login to participate
Endpoint Management & Virtualization DownloadsRSS

Tim's Handy SVS Tools

tperkins's picture

Here's a collection of three VBS scripts I wrote to enhance SVS. I was really impressed with Jeremy Sanderson's Internet Explorer Virtualizer, and got a crazy idea to create a similar tool -- which eventually turned out to be three.

I really like SVS, so I decided to make some VBScripts that would make my life just a wee bit easier. These scripts are my first (ever) attempt at coding in VBScript. I normally script in Perl or PHP, so if you're a developer and you peep the source, don't throw up! Realize that I constructed these tools by doing a lot of "Googling," so if you have any hints/suggestions, feel free to contact me.

Currently, Tim's Handy SVS Tools consist of three .VBS files.

  1. Layerizor.vbs is for launching a "non-virtualized app" in a layer.
  2. LayeredAppLauncher.vbs is a VBScript made for those who absolutely hate how when you Activate/Deactivate a layer your shortcuts get all messed up. It will check if a file is available, then if it's not, it will ask you if you'd like to activate the application's inactive layer and launch the app.
  3. SendTo Scratch Layer.vbs allows you to right click on an executable and use the SendTo feature of Windows.

Before you use any of these scripts, please, at the very least, check out the Known Bugs near the bottom of this document.

Script Breakdown

Layerizor.vbs

The inspiration for this script was the VirtualIE.vbs script that an Altiris employee made available. I thought to myself, "Why not make it more generic?" So I did.

Before you even think about using Layerizor, make sure you create whatever target layer(s) you think you might want. I created an empty layer called "! Scratch" and a layer called "+ Internet Explorer". The reason that I prefixed my layers with a ! and a + is so that the SVS Trinket puts them at the top of the list.

To use the Layerizor, simply create a shortcut to wherever you've installed my scripts (I use %PROGRAMFILES%\Altiris\Software Virtualization Agent\Scripts).

You can do this by either doing a right-click drag to wherever you want your shortcut (and selecting Create Shortcuts Here), or by right clicking on the target directory and using New -> Shortcut).

Now that you have a nice, hot off the press shortcut, double click it. You will get a humongous dialog box explaining the arguments you can pass to it. If you have a photographic memory, feel free to close it; otherwise, drag that window out of your way, right click on the shortcut, and go to Properties.

Modify the arguments for the Target to make it do what you want it to (I've included some example .lnk files for you to check out). Click "Change Icon..." and browse to whatever application you want to layerize and select its icon.

Click OK. You can now test your new Layerized application. There are 2 things you can do to verify that it is working properly. First, open up the SVS Admin and verify that the layer you created for your Layerized application is started. Second, try opening up the application via your shortcut, and while it's running, deactivate the layer it's in. If the application is indeed Layerized, SVS Admin should complain about an application currently running that needs to be terminated in order to proceed.

LayeredAppLauncher.vbs

I created this script for 2 reasons. First, I hate how when I activate or deactivate a layer it will change the order of my Start Menu/Desktop Icons. Second, I don't know how I got in this situation, but I had a layer deactivated and the desktop icon was still kicking around. I didn't realize the layer was deactivated so I double-clicked on the desktop icon and then Windows—in all of its infinite wisdom—decided to try to find the application. It ended up finding it in c:\fsldr and then running it—thereby, negating any of the advantages of having it in a layer in the first place. Now, I know there is a registry option I can use to hide the fsldr directory (which I actually have turned on now), but I still wanted the ability to have it ask me to launch the layer if it's not activated.

Using the LayeredAppLauncher.vbs script is relatively easy. Create a new short-cut to the LayeredAppLauncher.vbs script. Double click on that new shortcut for the usage dialog box. Set the arguments to LayeredAppLauncher.vbs appropriately. Once that is done, voila! No more adjusting your anal-retentively-organized shortcuts (you may want to end up removing any shortcuts from the target layer so you don't end up having two shortcuts to the same app).

If you'd like to change the icon of your shortcut, simply go to the "Change Icon.." button in the preferences of the shortcut and browse to wherever your target executable is.

Also, I don't know what on earth causes this, but some applications (Trillian in particular) change the Target of the shortcut for some reason. So, if you'd like to be safe (and not have anything mess with your shortcut target), MAKE SURE you check the Read-Only attribute of the shortcut. If anyone knows why this happens, and if there is anyway around it, please e-mail me and let me know!

SendTo Scratch Layer.vbs

If you'd like to be able to right click on something and send it to a scratch layer, simply create a new layer in SVS called "! Scratch" (or modify the source code to the script), then, create a shortcut in your %HOMEDRIVE%\%HOMEPATH%\SendTo directory. I named my shortcut "! Scratch Layer". Now whenever I download questionable freeware/shareware applications from the net, I can quickly and easily run them in a layer!

Keep in mind, this SendTo script is absolutely not a replacement for actually installing an application into a layer.

KNOWN BUGS

Layerizor.vbs

Applications known not to work:
- Mozilla Firefox

LayeredAppLauncher.vbs

If the shortcut is not read only, Trillian changes the Target to its executable.

SendTo Scratch Layer.vbs

Sending ANY non-executable document, causes SVSCMD to crash.

CHANGELOG

2006-06-13: Initial release. Nothing changed.

License: AJSL
By copying this script, you agree to the terms and conditions in the Altiris Juice Software License
Support: User-contributed tools on the Juice are not supported by Altiris Technical Support. If you have questions about a tool, please communicate directly with the author by visiting their profile page and clicking the 'contact' tab.
Note: Please see the enclosed Readme.txt Disclaimer for the "no support" statement from the author.
Josh Bernson's picture

Excelent tools. Thanks!

These are excellent scripts to help with a few minor (but frequent) annoyances. I find the LayeredAppLauncher.vbs. While I’d guess that SVS will resolve many of the annoyances in future versions, your tools offer a nice solution until then, and the documentation is quite detailed too.

So I wanted to say thanks.