John R. Durant's WebLog

Blog of "The" Office Developer

Environment variables save time

I have been doing some SharePoint development, and I am using a variety of little utilities to get certain tasks done. However, in many cases, the utilities are installed as part of an SDK, a toolkit or something else. For example, to install a Web Part package to a Windows SharePoint Services-enabled computer, I use stsadm.exe. so, to install a Web Part I go to the command line and type:

stsadm.exe -o addwppack -filename deployOfficeTalk.cab

The only thing is, the utility is in one place, and I hate having to type the whole filepath in the command line. I usually use the Visual Studio .NET 2003 Command Prompt (it has all of the key paths already configured), so, what I normally do is add the paths to my favorite utilities to the environment variables this command prompt uses.

You can find it in: c:\program files\microsoft visual studio .net 2003\common\tools\vsvars32.bat.

Open the batch file and find the "PATH=" add a semicolon and append the path to your utility. The next time you open the prompt, you can just use your utility from any directory.

You can also change the system environment variables (either in the Control Panel) or the Windows registry.

 Rock thought for the day: So, I am driving my boys to their baseball game last night, and my 6 year old turns to me and says, "Pop, I think it smells like Teen Spirit in here." with a smile. That was my hint to throw in the first song on the Nevermind album. He likes the beginning riff. Who doesn't?

Rock on

Published Friday, June 04, 2004 2:38 PM by johnrdurant

Comments

 

julie said:

*smile* I listened to that riff twice today... my 6 year old likes it as well.
June 4, 2004 3:36 PM
 

John Gibbs said:

Check out the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

You can add an entry for each of your tools so that regardless of the PATH environment variable setting they will be found. This also helps keep your PATH length down.
June 4, 2004 6:22 PM
 

John R. Durant said:

Nice call. Regrettably, it is in HKLM rather than HKCU, so the settings are for all users. There is another setting for users, but I will have to dig it up.

Thanks for responding!
June 7, 2004 9:53 AM
 

John R. Durant said:

Julie,
Music is fun. I like to listen to all kinds and expose my kids to all sorts of music. I was listening to some Baroque music on my way in to work, but I will probably listen to Blue Grass country on my way home, or some Offspring. I am generally opposed to 'Hip Hop' though. Not all of it as a matter of course, but nearly all of it.
June 7, 2004 9:55 AM
 

John R. Durant said:

Crud. Just realized that I transposed the d and n in my URL for my blog. I'm dumb.
June 7, 2004 9:57 AM
 

Julie said:

John, While I don't often listen to Blue Grass, I do like some rock-a-billy and I, too, an generally opposed to 'Hip Hop' or anything I call "Wah music" (you know that wah wah dance thing in the background).... been comparing notes with the OfficeZealot's on music lately... they've now got me stuck on digital media *sigh*
June 8, 2004 9:36 PM
 

John Gibbs said:

Julie, I think you hit the proverbial 15" woofer on the cone by using the term 'background'. I've long considered hip-hop and rap the 'background noise' of life.

This isn't really a derrogatory characterization--the musicians themselves routinely expound on the virtues of "keeping it real," which I take to mean focusing on topics that are natural and easy to digest because people routinely experience the same.

I 'feel' hip-hop and rap on occasion but for the most part i ignore it like other background noises. For example, birds chirping and wind ruffled leaves heard on a bike ride--it's not good, it's not bad, but it is sometimes remarkable.
June 9, 2004 3:44 AM
 

John R. Durant said:

There are a few groups that cross over a little, and I like it. Rage Against the Machine did great cross-over, as do Linkin Park. It can be done, but it's got to be clever and musically engaging.
June 24, 2004 12:10 PM
 

John R Durant s WebLog Environment variables save time | Hair Growth Products said:

June 9, 2009 10:55 PM
 

John R Durant s WebLog Environment variables save time | work from home said:

June 16, 2009 9:20 AM
 

John R Durant s WebLog Environment variables save time | pool toys said:

June 18, 2009 5:06 AM
 

John R Durant s WebLog Environment variables save time | bird baths said:

June 19, 2009 5:53 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker