Thursday, May 14, 2009

VNV Nation Box Set – Reformation 01

I received today the Reformation 01 box set (limited edition) by my favorite band “VNV Nation” that I pre-ordered at Amazon.com, who still sells it for only $21.xx dollars. (This is not my first exclusive post about VNV Nation. You can check out the other ones to learn more about VNV here and here.)

The limited edition of the Reformation 01 box set by VNV Nation is a real bargain. For little more than the price of a regular album CD you get 2 CD's and a video DVD with 8 tracks recorded at live concerts in Europe (mostly Hamburg, Germany).


Backup Link to Video on Vimeo
Download this video in AVI format in High Definition (1280x720, 81 MB)

Video Notes and Credits: The video above was edited by me and includes snippets from the DVD  that is part of the Reformation 01 box set. It also uses various images that are not part of the box set and video snippets from the viral “Illusion” video with animations by Andrew Huang, which were unfortunately not included in this box set (it would have been the right place for it though :) ). All music by VNV Nation.

I also like to remark that the box set includes the first ever LIVE ALBUM by VNV Nation, so fans who prefer VNV Nation live over the studio recordings (like I do) do not have to fall back on the not 100% legitimate Live album solution by ripping the audio tracks of the previously released Pastperfect Live DVD :). Vnv Nation - Pastperfect Limited Edition.

The latter one was actually suggested by Ronan and Mark from VNV themselves, when I meet them by accident in Berlin and asked them (AGAIN) why there is no VNV Live Album yet. I think I sent them all in all 2 or 3 additional emails before I talked to them in person and after. Well, the message finally “found its way home” hehe.

Ronan Harris, the main guy behind VNV Nation, is very responsive to contact attempts and close to the fans and not such an arrogant and careless asshole like the guys from Depeche Mode (a band that I used to adore for about 20 years of my life :( ). VNV has a MySpace page where you get fresh news and updates via their MySpace blog and also some nice goodies sometimes, like a preview of upcoming CD releases via the MySpace audio player. They did this for this Box Set actually.

vnvbanner-2 
VNV Nation is also on tour soon. The 2009 tour is called “Faith, Power and Glory”. Some tickets are on sale via Fan Direct sale (cheaper) at a ticket solution that I developed for the most part (and my old company hehe). It’s an older and heavily customized solution, because of it’s unique use for fan direct sales by artists. More tour dates and link to regular ticket purchases are available at this blog post at the VNV MySpace blog.

A new album with the same title as the tour will be released by VNV Nation on June 23, 2009. You can pre-order "Of Faith, Power and Glory" at Amazon.com for only $13.99

Now back to the Reformation 01 box set :)

CD 2 of the set includes in addition to various remixes of known songs also some new material, which was previously unreleased.

Last but not least some comments about the box set itself. It's of high quality, compared to other box sets by other bands that I have seen myself in the past. It also contains a thick booklet that wouldn't fit into a regular CD case. The only bummer here is that the booklet is glued to the box set and thus hard to read in comfort because of the 3 discs next to it (when you unfold the whole set).

You can get a good idea about the quality of the box set by looking at the large version of the product image that was provided by Amazon. Use the zoom feature to get a real close look at the material and the "engraved" VNV Nation logo. That's why is the cover so dark, because it isn't printed color. You can feel it (if you bought it :))

p.s. Yes, the links to Amazon.com are affiliate links and I will get $1 or so commission if you decide to by the set from Amazon, right after you clicked on my link. This is not the reason for this post and if you know me a bit better, you wouldn’t even assume that I would do something like that. But for those folks who don’t know me, be happy about this unnecessary disclaimer and shut up :).

VNV Nation – Reformation 01 – 3 Discs Box Set - Track List

Reformation 01 – CD #1 (the Live Album)

01    Joy              05:24
02    Chrome           04:49
03    Testament        06:22
04    Nemesis          04:37
05    Endless Skies    05:58
06    Farthest Star    05:06
07    Procession       05:26
08    Entropy          05:17
09    Illusion         04:51
10    Arena            05:34
11    Honour 2003      07:06
12    Perpetual        08:47


Note: Sound samples for every track of CD 1 and CD 2 are available for free at the Amazon.com web site.

Reformation 01 – CD #2 (the Remixes)

01  Chrome (27.2 Mhz Remix by Modcom)          06:26
02  Chrome (Sitd Remix)                        04:58
03  Chrome (Apoptygma Berzerk Remix)           04:42
04  Interceptor (ABM Version by VNV Nation)    05:35
05  Nemesis (S.A.M. Remix)                     03:50
06  Carry You (Frozen Plasma Remix)            06:36
07  Still Waters                               07:36
08  Suffer                                     07:00
09  Precipice                                  05:40
10  As it fades (2nd Mvmt. by VNV Nation)      03:31
11  Main Theme (from 'Gene Generation')        02:45
12  Mayhem (from 'Gene Generation')            02:03
13  The Lair (from 'Gene Generation')          02:57

The songs in red are NEW and previously unreleased. I also do not recall the songs from track 10-13, but I wasn’t able to listen to all of them without being distracted to be sure. Well, three new songs as bonus is better than none, but 7 would be more than twice as good hehe.

 

Reformation 01 – DVD #1 (the Live Videos)

01 Farthest Star     05:15
02 Chrome            04:48
03 Nemesis           06:00
04 Illusion          04:54
05 Homeward          05:42
06 Arena             05:57
07 Honor 2003        06:54
08 Perpetual         08:49

Only Honor 2003 was previously available on DVD Video. It’s a different recording though. A previous live recording of Honor 2003 is one of the hidden “Easter Eggs” of the “Pastperfect” Live DVD. Oops, did I say that out loud? Sorry ;)

Cheers!

Carsten aka Roy/SAC

Tuesday, May 12, 2009

The Cirque du Soleil Story - Odyssea - The dreamer's Odyssey

Source: Cirque du Soleil

This article is part of my Cirque du Soleil Information Primer article series. See the main article here.

cirquedusoleil-logo-silverOdyssea - The dreamer's odyssey cirque

The History of Cirque du Soleil in their own words.

The Cirque du Soleil story is about a group of young people who wanted nothing more than the freedom to dream a dream.  Beginning with a street kid from Montreal called Guy Laliberté, it's the tale of individuals who have come forward at special moments in time to move that dream forward, and share it with the world.

1979 - 1980: The inspiration

Odyssea--1-image1

In the late 1970s, Guy Laliberté attends a concert by Zachary Richard, a musician from New Orleans. The show inspires him to organize a school trip to the city, which proves to be a big success. It's the first time he experiences bringing a group of people together for travel and entertainment, and it sets the teenager on his life path.

Chance encounters occur that will galvanize the still unformulated dreams of the people who are to found Cirque du Soleil.

It is a time of creative ferment and great energy in Quebec that is gathering momentum.

1980 - 1981: Artists gather in Baie-Saint-Paul

Odyssea--2-image1

Guy Laliberté, barely 20, burns with a desire to entertain and travel. He leaves Montreal for the artist colony of Baie Saint-Paul where he comes together with a group of young street performers who have pooled their talent and dreams and founded “Les Échassiers de Baie-Saint-Paul” (the Baie-Saint-Paul Stiltwalkers).

The stiltwalkers’ group also features fire-eaters, jugglers and other buskers. The group includes Gilles Ste-Croix, who will later become Artistic Director of Cirque until the production of Dralion.

Riding the crest of the Quebec street entertainer movement—on a roll since the mid-70s—a group of young stilt-walkers, fire-eaters and assorted mountebanks is born.

They are loud, eccentric, brash, impossible to avoid.

1981 - 1982: An idea takes form

Odyssea--3-image1

In 1982, Guy Laliberté and Gilles Ste-Croix create another association to support their work with the Échassiers de Baie-Saint-Paul: “Le Club des Talons Hauts,” or the High-Heels Club. Through the Club, they decide to organize a street performer's festival, La Fête Foraine de Baie-Saint-Paul. Keeping a neglected tradition alive, they walk on stilts, juggle, and breathe fire to the crowd's obvious delight.

This talented group of young Quebec street entertainers has come together under a lucky star. Although a full two years pass before Cirque du Soleil as we know it today is created, its founders say that it was at that mystic moment in Baie Saint-Paul in 1982 that Cirque du Soleil was conceived.

The aurora borealis hits Baie Saint-Paul on the first day of La Fête Foraine. The sun has set but the sky is streaked with waves of otherworldly light. Green and silver refractions chase each other across the dome of the sky throughout the performance.

1983 - 1984: Cirque du Soleil is born.

Odyssea--4-image1

In 1984, with the financial assistance of the Quebec government, Cirque du Soleil is officially formed by Guy Laliberté as part of the celebrations surrounding the 450th anniversary of Jacques Cartier's arrival in Canada. Guy is inspired to choose the name by the sun itself, a symbol of youth, energy, power and light.

His goal to bring together creative talent to delight new audiences in new locations takes a bold step forward.Cirque becomes a multicultural gathering point, with performers from Quebec, Belgium, Switzerland and Argentina.

The crazy dreams of a two friends begin to take wing. And maybe those dreams aren't so crazy after all. Maybe this idea about a different kind of circus is something that audiences will respond to. Maybe it will flourish.  Sometimes you just have to trust to fate and follow where your dreams lead you...

Youth, boldness, instinct, vision and a certain zany talent are their stock in trade.

1985 - 1986: Inspiration from abroad.

Odyssea--5-image1

In 1985, Cirque welcomes Guy Caron as Artistic Director. Guy has toured the world and discovered new trends in live entertainment of all kinds. Cirque experiences a burning desire to return to the circus tradition the esteem and quality it knew at the beginning of the century.

Guy Caron brings in Franco Dragone to teach Cirque artists commedia dell'arte. Inspired by the best of what is happening internationally,  Cirque creates a new theatricality and adopts a vision whereby rules exist only to be broken.Cirque also performs La Magie Continue at the 1986 universal exposition in Vancouver

Guy Caron scours Europe and Asia to cast We Reinvent the Circus. He is looking for new ways of doing things. The mandate is clear: to produce a European-style professional show anchored in acrobatics, with original music and without animals.

From the Chinese we learned about perfecting the blend of presentation, music and choreography--about grace and beauty, gestures and smiles. We drew upon an Impressionistic sensibility, took everything that had existed in the past, and pulled it into today.

1987: Cirque decides to make it or break it in  L.A.

Odyssea--6-image1

After years of honing its craft across Québec and in cities throughout Canada, Cirque du Soleil mounts We Reinvent the Circus. In 1987, Cirque takes the biggest risk in its history by agreeing to perform at the Los Angeles Festival, without the funds necessary for a return trip.

Its future will depend entirely on being successful in the U.S. market. The gamble pays off. The show is performed in Los Angeles, San Diego and Santa Monica to rave reviews. It then successfully tours the U.S. for two years.

Franco Dragoné is now taking on increasing influence directing all major Cirque productions from Nouvelle Expérience to La Nouba.

Cirque du Soleil leaves its home province for the first time in 1985 to take its show to neighbouring Ontario. In 1986, Cirque du Soleil visits eight more cities across Canada, including Vancouver, and holds performances at Expo '86.

"Cirque du Soleil comes to us from Montreal, but surely via the moon or Mars."-S.D., Los Angeles Times

1988 - 1990: Nouvelle Experience:a new level of theatricality

Odyssea--7-image1

Buoyed by its growing success, Cirque du Soleil begins attracting artists from around the world, particularly Russians whose proud circus and acrobatic tradition makes a valuable contribution. Cirque mounts Nouvelle Expérience, its most successful show yet.

Franco Dragoné becomes Director, pushing Cirque's theatricality to new limits. His impact is enormous: Franco's theatrical vision will inform Cirque's approach for years to come. Key to Franco's indelible stamp will be his successful creative association with set designer Michel Crête and, later, costume designer Dominique Lemieux. They will work together on every show until "O," after which new creators will take up the challenge.

Suddenly it begins to happen. The show, like a reluctant spirit hounded by a posse of mediums, slowly reveals itself. An organic resonance emerges: each act finds its place, a succession of moments as fleeting as they are eternal.

Long before the house lights go down and the excitement begins to build under the Grand Chapiteau, designers and craftspeople have put in months of work behind the scenes to create the perfect costumes and makeup to bring life to a cast of characters.

1990 - 1992: The magic continues: Saltimbanco and more

Odyssea--8-image1

In the year 1992 alone, Cirque encounters success in Japan with a show called Fascination and kicks off a 12-month engagement in Las Vegas with Nouvelle Expérience at The Mirage Hotel. Then it introduces a new show in Montreal: Saltimbanco. Today, the show is still playing to audiences around the world.As Cirque grows, it benefits from a greater number of artists, performers and creators who bring their own spark to the creative fire.

Saltimbanco is a celebration of life. Designed as an antidote to the violence and despair of the 20th century, this phantasmagoric show offers an alternative view of the urban environment brimming with optimism and joy.

"It is a circus, but then again it's not. Unquestionably, Cirque du Soleil Nouvelle Expérience is a visual and audio mind-twister bent on stir-frying your senses into a frenzy." —Las Vegas Sun

1992 - 1994: Mystère changes Las Vegas

Odyssea--9-image1

Having seen Cirque in action, the president of Mirage Resorts in Las Vegas, Steve Wynn, makes an offer: why not bring Cirque du Soleil to a permanent installation in Las Vegas? Cirque responds to the challenge of staging a show outside of the traditional big top, and resolves, in its own words, to "plant a flower in the desert."

In 1994, Mystère premieres at the Treasure Island hotel in Las Vegas, setting a new standard and changing the way live entertainment is presented in Las Vegas. Cirque du Soleil celebrates it 10th anniversary by staging Alegría, which premieres in Montreal.

Mystère's message is universal because movement, music and humor are universal. Mystère is so richly diverse that it can be experienced over and over again, every performance revealing something new and extraordinary.

Be obnoxious. Be stupid. Be sweet. Be nasty. Be masculine, feminine, androgynous. Be amazing.

1994 - 1997: New home, new media

Odyssea--10-image1

Cirque du Soleil now has four shows running: Saltimbanco, Mystère, Alegría, and its newest show, Quidam. Cirque decides that its artists must have a single home in which to gather, create, rehearse, and dream. The Studio, its new International Headquarters in Montreal, is born.

All of the shows will be created and produced in the new facility.The year 1997 sees the birth of a multimedia division, Cirque du Soleil Images, and the release of its first feature film: Alegría.

It's done The move, carried out over three weekends, goes very smoothly, and all employees are now ensconced in the new Studio. A few last-minute adjustments and everyone is able to get down to work.

As its repertoire grows and it moves into new and bigger premises, Cirque’s plans become even more ambitious and audiences flock to the Grand Chapiteaus in ever-greater numbers.

1997 - 1999: New Benchmarks

Odyssea--11-image1

Inspired by the success of Mystère, Steve Wynn, the president of Mirage Resorts, invites Cirque  to Las Vegas to mount "O" in a specially constructed theatre at the Bellagio Resort. "O" sets a new benchmark for excellence in theatrical entertainment everywhere.After almost 10 years of discussion, Cirque du Soleil finally teams with Disney to present La Nouba in Orlando.

The agreement occurs after direct intervention from Michael Eisner, chairman and CEO of Disney, who concedes to Cirque's long-maintained insistence that it retain creative control. Moreover, a custom-made theatre is built for Cirque’s unique requirements.

Quidam tours North America in 1997, while Saltimbanco ends its two-year European tour at London's Royal Albert Hall and Alegría kicks off its own tour of Europe. Saltimbanco tours Asia and the Pacific in 1999, while Quidam embarks on a four-year European tour.  Starting with Dralion in 1999, new creators like Stéphane Roy and François Barbeau pave the way for Cirque’s continued success.

Cirque’s performances are a unique balance of physical strength, art and beauty.

Audacity is deeply ingrained in Cirque’s culture. With Gilles' historic stiltwalkathon from Baie-Saint-Paul to Quebec City, Guy Caron's artistic instincts, and Guy Laliberté's go-for-broke gambling spirit, it's been there from the beginning. It's stitched into the very fabric of the Grand Chapiteau.

1999 - ?: The dawn of a new era.

Odyssea--12-image1

Cirque also begins looking beyond live entertainment for new means to share their which wonder, joy and creativity. The team produces Cirque du Soleil Presents Quidam for television, and the IMAX film Journey of Man.Guy Laliberté declares 2001 the beginning of "Cirque du Soleil, Volume 2."

In 2002, Varekai, directed by Dominic Champagne in collaboration with twelve other talented creators, begins its journey. Since its origins, Cirque has been an unique meeting space for more than 50 creators with big dreams. Cirque du Soleil wows its largest audience ever when it presents a one-of-a-kind act at the 74th Annual Academy Awards® in 2002.

In 2003, the television documentary series "Cirque du Soleil Fire Within," an intimate and revealing inside look at the making of a Cirque show, wins an Emmy award plus two Gemini awards. While Quidam tours Japan in 2003, the adults-only show ZUMANITY premieres at the New York-New York Hotel & Casino in Las Vegas, and Cirque du Soleil Images completes “Solstrom,” a family-oriented TV series that merges acrobatic acts with dramatic comedy.

As the future approaches, Cirque prepares to embark on new projects and connect with new audiences everywhere. Dreams never die. Come along as they take on new forms with us

Final words from Guy Laliberté, Founder of Cirque du Soleil

So long as we keep our sense of excitement at discovering new paths, we’ll never lose our determination to share that excitement with every audience, at every performance

Today, we have our place in the sun and a roof over our heads, but once upon a time the street was our home. I would say we took a little dusty carpet and shook it out pretty well We've shown the world that under the dust, something exceptional is coming out of contemporary circus. My mission has not yet been accomplished. I still have a lot of entertaining to do.

For more information about Cirque du Soleil, their shows, their TV productions, their Music, their DVDs and more, check out my Cirque du Soleil Primer article and subsequent articles.

Cheers!

Carsten aka Roy/SAC

Cirque du Soleil Articles in this Series

Monday, May 11, 2009

MS DOS Commands, Wild Cards, Input/Output Redirection and Variables

While I was looking for ways to make my life easier by automating things, I rediscovered the MS DOS batch features of the latest MS DOS release and even more extended version of MS DOS for the early Microsoft Windows 32 bit Operating Systems, like Windows 95, Windows CE and Windows 98 (dubbed MS DOS 7).

dospromptani You can accomplish a lot of things right from the DOS prompt without needing to program fancy Windows Applications or something like that.

Many things where I thought the use of “real” programming languages like Visual Basic or VBScript would be necessary, can be accomplished by using sequences of MS DOS commands in a Batch File (.BAT).

BATCH commands are supported by any Microsoft Windows Operation System right out of the box. You do not have to install anything, not mess around with permissions nor do you require Administrator rights and permission to write, edit or execute batch scripts.

The Basics for Newbies

To learn about the available commands and functions that you can use in BATCH files, open a MS DOS window first. To do that, click on “Start”, then “Run”, type “cmd” and then press the ENTER key on your keyboard.

In the MS DOS window type “help” and then press ENTER. Returned will be a list of commands with a brief description of their purpose right next to each of them. Type “help COMMAND”, where COMMAND stands for any command that was listed by “help”, to get a detailed documentation and description of the individual DOS command. There is actually a BATCH file that was written by Rob Van der Woude, which generates a HTML document from those “help” commands, something like a documentation or reference, if you will. You can download the script source here. Save it as AllHelp.bat and then execute it. When it is done, you should have a new file with the name “allhelp.htm” in the same folder as the batch file itself. You can open the HTML file with any web browser.

That covers the basics. The rest of this post is more advanced and for people who are familiar with the basic MS DOS batch features and syntax.

MS DOS (and Windows) Wild Cards

I will explain the wildcards characters used in MS DOS and also Windows for File and Folder Filtering in commands like the "DIR" command and other file based operations. It causes sometimes for confusion and even confused me that I decided to look it up and also conducted some tests to verify the claims made by various people.

There are two (2) wild card characters that can be used for the file system commands in MS DOS and Windows; the question mark character (?) and the asterix or star character (*).

  • ? Matches any single (1) character. It also matches no (0) characters (none), if it is being used in the leading or trailing position of the filter.
  • * Matches matches any and no characters, regardless of its position in the filter

Here are some examples to illustrate the subtle nuances between each of the two wildcards. Joker_Playing_Card_clipart_image

abc*f   matches abcdf, abcdef and abcf
abc*   
matches abc, abcd and abcde
*def   
matches def, cdef and abcdef

abc?ef  matches abcdef but NOT abcef
abc?   
matches abc and abcd but NOT abcde
?
def   
matches def and cdef but NOT abcdef (and also NOT bcdef)
??def   matches def, cdef and bcdef but NOT abcdef

File System Commands Input and Output Routing

Placeholders used:

  • COMMAND stands for the command line command string, which could be anything from the "DIR *.*" command to "ECHO Hi"
  • SRC stands for Source
  • DEST stands for Destination
  • STDIN (0) stands for Standard Input or channel 0
  • STDOUT (1)  stands for Standard Output or channel 1
  • STDERR (2) stands for Errors or channel 2

STDIN and STDOUT can be various different things, such as:

  • NUL = Nothing (usually used for suppressing any output to anywhere)
  • CON = Console or Screen redirect-detour
  • PRN = Printer (Only works, if a DOS printer is configured on LPT1)
  • AUX = Auxiliary
  • COM1 ... COM9 = Serial Ports 1 to 9
  • LPT1 ... LPT9 = Parallel Ports 1 to 9
  • FileName = a File Name, File Path/Location & File Name
  • Command = another Command

The character “<” (less than) stands for Input, the character “>” (greater than) stands for Output (with overwrite) and 2x “>” (greater than)  = “>>” also stands for Output, but without overwrite (appending).

COMMAND>DEST redirects the Standard Output of COMMAND to DEST (Overwriting Previous Outputs)
COMMAND>>DEST redirects the Standard Output of COMMAND to DEST (Not Overwriting Previous Outputs)
COMMAND<SRC feeds COMMAND via the Standard Input from SRC

If you redirect the output to a File for example, you maybe noticed that sometimes not everything is being redirected into the file and some output still occurs on the screen. The reason for that is that you only redirect the STDOUT channel, but not the STDERR channel, which some commands and applications actually use for their error messages output. If you want to redirect the STDERR output to the same output channel specified as DEST use the following syntax:

COMMAND>DEST 2>&1

COMMAND output ">" redirect to DEST (STDOUT), "space", 2, which stands for STDERR and ">" redirect to “&1”, which stands for STDOUT. (Update 7/18/2009: I updated the post and fixed a typo that I made before. I entered 2>&0 instead of 2>&1, which would crash the Batch, because you would feed the error messages back as input to the command. I apologize for this error.) 

Variables in MS DOS Batch

The basics are clear to most folks, like setting a new environment variable with Set VARNAME = VALUE, returning the current value of VARNAME via SET VARNAME or using the VALUE of VARNAME via %VARNAME% in the batch script code. Also the use of the runtime generated variables %1 … %X for the command line parameters that were passed to the batch script are basic BATCH script knowledge.

As you know, parameter values that include the space (blank) character, must be enclosed in double-quotes (“) to avoid that the BATCH script will interpret the individual segments before and after a space as separate parameters. For example BATCH.BAT C:\Documents and Settings would result in three (3) parameters in the Batch Script, like:

%1 = C:\Documents
%2 = and
%3 = Settings

You have to enter BATCH.bat “C:\Documents and Settings” instead to have the path only appear as one (1) parameter in the batch, which is accessible via %1. The problem is that %1 will also include the double-quotes, which are not really part of the value that you want to pass. In many cases this does not matter or is even good, if you invoke file commands for example, where the parameter should again be enclosed in double-quotes to work properly.

To remove the enclosing (“) (double-quotes) from a parameter, add the character “~” (tilde) after the “%” (percent) sign. For example: %~1

This does not work for regular environment variables that were created via the “SET” command. The following would not work and error out, if you try to execute it:

SET VAR=”VALUE”
ECHO %~VALUE%

Other characters that require that a parameter value will be enclosed in double-quotes are: &()[]{}^=;!'+,`~

Did you know that %0 also exists? %0 stands for the  command  itself. In the examples above, %0 would return BATCH.bat. Note: Calling the script via the command BATCH without the extension “.bat” is also valid, if no other executable with the same base name exists in the same directory or path (e.g. a BATCH.exe or BATCH.com). If the batch file is executed this way, %0 also would not include the extension and simply return the value BATCH.

The SET Command

Typical use would be this: Set Counter = 0  where the value of “Counter” would then be accessible in the batch script (and beyond!) via %Counter%

Using the parameter /A indicates that the variable has a numeric value and should also be treated as such. This is important if you want to do arithmetic operations with a variable such as: set /A Counter+=1

This is especially powerful in combination with the “Delayed Environment Variables Expansion” feature enabled.
See more about this option further down below.

set /P VARNAME=Prompt_String

Displays “Prompt_Sting”, then waits for user input (in DOS, not a Windows Input Box) and stores the entered value in the variable VARNAME once the user finished his input by pressing the ENTER key.

Arithmetic Operators for the SET Command

()                  - grouping
! ~ -               - unary operators
* / %               - arithmetic operators
+ -                 - arithmetic operators
<< >>               - logical shift
&                   - bitwise and
^                   - bitwise exclusive or
|                   - bitwise or
= *= /= %= += -=    - assignment
&= ^= |= <<= >>=
,                   - expression separator

String Substitutions

%PATH:str1=str2%  = Expands PATH and substitutes any occurrences of str1 with str2

String Offsets

%PATH:~10,5% = Expands Path and use 5 characters of the value from position 11 (offset) only

Left & Right String Functions

%PATH:~0,-2% = Expands PATH and uses all but the last 2 characters of the value

Other system environment variables

Other variables than %PATH%, which I used in the previous examples, which are good to know, but also require that EXTENSIONS were enabled via the SETLOCAL ENABLEEXTENSIONS command or via cmd.exe parameter.

  • %CD% = Path to current directory
  • %DATE% = Current Date
  • %TIME% = Current Time
  • %RANDOM% = Expands to a random number between 0 and 32767
  • %ERRORLEVEL% = Returns the current ErrorLevel value
  • %CMDEXTVERSION% = Version of the current command processor extensions
  • %CMDCMDLINE% = original command line that invoked the command processor

Delayed Environment Variables Expansion

Always disabled by default, but may be enabled/disabled via the /V command line switch (/V:ON; /V:OFF) to CMD.EXE or via the command “setlocal enabledelayedexpansion” at run-time. 

Qlemo pointed out correctly via a blog comment that you can also make a change to the system registry, to enabled delayed expansion of environment variables by default, if CMD.EXE is invoked. This can be set on individual user level (HKEY_CURRENT_USER) or machine wide, for all users (HKEY_LOCAL_MACHINE).

Key: HKCU or HKLM\Software\Microsoft\Command Processor
Value Name: DelayedExpansion
Value (REG_DWORD): hex:0x1 to enable or hex:0x0 to disable delayed expansion.

If you don't know how to change the settings in the registry, never mind, because only experienced users should make modifications to the system registry. Changes to the registry can cause the system to crash and worse.

Disabled delayed variables expansion means that variables will be expanded at the time they are parsed, which is bad, if the value of the variable is supposed to change within the batch script itself. Here is a nice example script to illustrate the different behavior.

   1: set VAR=before
   2: if "%VAR%" == "before" (
   3:     set VAR=after
   4:     if "%VAR%" == "after" @echo If you see this, it worked
   5: )

If you run this, the script should return nothing. The second IF statement never can become true, even though you have the “SET” command right before it that should have changed the variable’s value to make the IF statement true. Why? Because %VAR% was already set to “before” and because of that expands to “before” throughout the entire script. Now add at the very top the line “setlocal enabledelayedexpansion” and run the script again. Now you should get the text “If you see this, it worked” back as a result.

Here is another example of the implication of the “setlocal enabledelayedexpansion”  statement.

   1: set LIST=
   2: for %%i in (*) do set LIST=!LIST! %%i
   3: echo %LIST%

This script will not return the list of all files in the current directory. It will only show one file name of the directory. It would work the same way as if you would have made the FOR command statement to:

for %%i in (*) do set LIST=%%i

Add “setlocal enabledelayedexpansion”  at the top of the script again and run it once more.
Another typical use where enabling delayed expansion is crucial, are Counters and other mathematical operations and manipulation of values during the execution of a BATCH script.

The SHIFT Command

The SHIFT Command is probably difficult to get its head around it. The applications are versatile. Shift basically shifts the sequence of parameters to the left. Parameter 2 becomes Parameter 1, Parameter 1 disappears and Parameter 2 would be empty, unless there is another Parameter 3. This is hard to grasp, so here is a short sample batch that illustrates this behavior.

   1: @echo off
   2: Call :testfn 1 2
   3: goto :EOF 
   4: :testfn
   5: echo 1 = %1, 2 = %2
   6: echo shift
   7: shift
   8: echo 1 = %1, 2 = %2

Results:


1 = 1, 2 = 2
shift
1 = 2, 2 =

There are other variables like the ones starting with 2x “%” like %%a or variables that are enclosed in “!” instead of “%”, like !VARNAME! instead of %VARNAME%, but that would require me to make this post much longer than it already is. Check the help for the “FOR”, “SET” and “CMD” commands to learn more about them.

Additional Resources to BATCH Scripting

I hope that you find this post of mine useful. Use the comment section below for comments, feedback, suggestions and expressions of appreciation :). Thank you.


Cheers!


Carsten aka Roy/SAC