Hi All,

I opened a Command window and changed its directory to one that contained a
HelloWorld.cs program.

I ran "csc HelloWorld.cs" and got:

'csc' is not recognized as an internal or external command,
operable program or batch file.

I ran "vsvars32" and got:

Setting environment for using Microsoft Visual Studio .NET tools. [snip]

(which worked because I had previously amended PATH to include
"[snip]\Microsoft Visual Studio .NET\Common7\Tools")

Of course, if I opened another Command window, "csc HelloWorld.cs" would
again give rise to the "'csc' is not recognized" message because the changes
made to the environment variables in the first window were made only to the
session in which that window was created.

I thought if I ran "vsvars32" in Start | Run the changes would be
persistent, but that has proven not the case.

I used vcvars32 in the Win2000Pro environment with no problems. What is
going on here?

TIA,
Richard

Re: How to run vsvars32.bat to make its changes persistent? by Lloyd

Lloyd
Tue Sep 06 22:50:33 CDT 2005

XP don't use .bat file anymore!

However if you do: My Computer => Properties => Advanced => Environment
Variable
You could setupt global (or user dependent) environment variable, such as
the Path...



Re: How to run vsvars32.bat to make its changes persistent? by Richard

Richard
Tue Sep 06 23:38:25 CDT 2005

Hi Lloyd,

Thanks for confirming that XP doesn't honor .bat files to set environment
variables. But there ought to be a programmatic way to do the setup that
vsvars32.bat offered to setup. How about Web Script Host?

I just think doing it manually through the Environt page (which I accessed
through Start | Control Panel | System | Environment; Microsoft offers more
that one way to skin a cat, eh?).

Regards,
Richard



Re: How to run vsvars32.bat to make its changes persistent? by William

William
Tue Sep 06 23:58:16 CDT 2005

http://objectsharp.com/Blogs/dave/archive/2003/12/10/227.aspx
http://www.tapadiya.net/pradeep/DotNetTools.htm
http://weblogs.asp.net/cazzu/archive/2003/11/03/35474.aspx
http://www.gotdotnet.com/workspaces/workspace.aspx?id=3751cc72-1345-4872-96a1-99c9d64e7c2d

--
William Stacey [MVP]

"Richard Lionheart" <NoOne@Nowhere.net> wrote in message
news:OvjxhgzsFHA.3512@TK2MSFTNGP15.phx.gbl...
> Hi All,
>
> I opened a Command window and changed its directory to one that contained
> a HelloWorld.cs program.
>
> I ran "csc HelloWorld.cs" and got:
>
> 'csc' is not recognized as an internal or external command,
> operable program or batch file.
>
> I ran "vsvars32" and got:
>
> Setting environment for using Microsoft Visual Studio .NET tools. [snip]
>
> (which worked because I had previously amended PATH to include
> "[snip]\Microsoft Visual Studio .NET\Common7\Tools")
>
> Of course, if I opened another Command window, "csc HelloWorld.cs" would
> again give rise to the "'csc' is not recognized" message because the
> changes made to the environment variables in the first window were made
> only to the session in which that window was created.
>
> I thought if I ran "vsvars32" in Start | Run the changes would be
> persistent, but that has proven not the case.
>
> I used vcvars32 in the Win2000Pro environment with no problems. What is
> going on here?
>
> TIA,
> Richard
>



Re: How to run vsvars32.bat to make its changes persistent? by Jon

Jon
Wed Sep 07 01:31:01 CDT 2005

Lloyd Dupont <net.galador@ld> wrote:
> XP don't use .bat file anymore!

Yes it does! Do you mean it doesn't use autoexec.bat? That would be
reasonable - but it certainly *does* use batch files.

> However if you do: My Computer => Properties => Advanced => Environment
> Variable
> You could setupt global (or user dependent) environment variable, such as
> the Path...

Indeed.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: How to run vsvars32.bat to make its changes persistent? by Lloyd

Lloyd
Wed Sep 07 02:14:52 CDT 2005

> Lloyd Dupont <net.galador@ld> wrote:
>> XP don't use .bat file anymore!
>
> Yes it does! Do you mean it doesn't use autoexec.bat? That would be
> reasonable - but it certainly *does* use batch files.
Yep, it's what I meant.



Re: How to run vsvars32.bat to make its changes persistent? by William

William
Wed Sep 07 08:20:11 CDT 2005

command.com still uses autoexec.nt and config.nt which are batch files.

--
William Stacey [MVP]

"Lloyd Dupont" <net.galador@ld> wrote in message
news:eJ1$Uu3sFHA.908@tk2msftngp13.phx.gbl...
>> Lloyd Dupont <net.galador@ld> wrote:
>>> XP don't use .bat file anymore!
>>
>> Yes it does! Do you mean it doesn't use autoexec.bat? That would be
>> reasonable - but it certainly *does* use batch files.
> Yep, it's what I meant.
>
>



Re: How to run vsvars32.bat to make its changes persistent? by Richard

Richard
Wed Sep 07 23:15:09 CDT 2005

Hi Guys,

Somehow, I think we got buried in the minutiae and lost sight of the
central question. I wanted to run vsvars32.exe in order to augment the
environment variables PATH, INCLUDE, LIB, and whatever else it my do.

I did that, if for no other reason, than to be assured the csc.exe would be
found when it was invoked from a Command window or from within .bat files,
regards what the current directory happened to be in the context of such
invocations.

I augmented the PATH (using Start/Control Panel/System/Environment to
augment PATH with the path to Microsoft Visual Studio .NET\Common7\Tools.
Then I invoked vsvars32.exe from Start | Run. That did not end up altering
PATH, according to Start/Control Panel/System/Environment.

Lloyd Dupont suggested the Windows XP no longer uses .bat files. But that's
a distraction. The real question is: How should I run vsvars32.exe so that
the environment variables are updated for various Visual Studio.Net
functionality works as expected?

From the discussion I've seen in this thread, I inclined to think I should
invoke vsvars32.exe from with autoexec.nt. Is that a correct solution? If
not, what is? (In the meantime, I'm going to try that.)

Thanks to all of you for hanging in until I get a resolution of this
question.

Best wishes,
Richard



Re: How to run vsvars32.bat to make its changes persistent? by Lloyd

Lloyd
Wed Sep 07 23:02:43 CDT 2005

Just testing eclipse right now.
Hey, much better than the version I tested earlier!
I'm still confused by some UI concepts but that looks good.
Beside I'm delving into SWT sourcecode to solve of my Uniscribe rendering
problems, that's great!

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1d889980c30f569c98c67a@msnews.microsoft.com...
> Lloyd Dupont <net.galador@ld> wrote:
>> XP don't use .bat file anymore!
>
> Yes it does! Do you mean it doesn't use autoexec.bat? That would be
> reasonable - but it certainly *does* use batch files.
>
>> However if you do: My Computer => Properties => Advanced => Environment
>> Variable
>> You could setupt global (or user dependent) environment variable, such as
>> the Path...
>
> Indeed.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: How to run vsvars32.bat to make its changes persistent? by Jon

Jon
Thu Sep 08 01:27:51 CDT 2005

Richard Lionheart <NoOne@Nowhere.net> wrote:
> Somehow, I think we got buried in the minutiae and lost sight of the
> central question. I wanted to run vsvars32.exe in order to augment the
> environment variables PATH, INCLUDE, LIB, and whatever else it my do.
>
> I did that, if for no other reason, than to be assured the csc.exe would be
> found when it was invoked from a Command window or from within .bat files,
> regards what the current directory happened to be in the context of such
> invocations.
>
> I augmented the PATH (using Start/Control Panel/System/Environment to
> augment PATH with the path to Microsoft Visual Studio .NET\Common7\Tools.
> Then I invoked vsvars32.exe from Start | Run. That did not end up altering
> PATH, according to Start/Control Panel/System/Environment.

Running vsvars32 from Start | Run won't do anything useful. It'll
change the environment variables for the new command shell, then exit
that shell.

> Lloyd Dupont suggested the Windows XP no longer uses .bat files. But that's
> a distraction. The real question is: How should I run vsvars32.exe so that
> the environment variables are updated for various Visual Studio.Net
> functionality works as expected?

You don't - you update the path in the same way that vsvars32 would do
*if* you ran it, and then when you start a command prompt you won't
*need* vsvars32, as everything will already be set up.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: How to run vsvars32.bat to make its changes persistent? by Richard

Richard
Thu Sep 08 11:19:15 CDT 2005

Great answer, Jon! It solved my problem, and that's my main goal.

> You don't - you update the path in the same way that vsvars32 would do
> *if* you ran it, and then when you start a command prompt you won't
> *need* vsvars32, as everything will already be set up.

I am saddened a little that there's not a more elegant solution. I'm sure I
never did this for Visual Studio 6.0 with MFC, ATL, etc. But since
everything seems to work as I expect, I'll get over it :-)

Thanks again for hanging in there with me.

Best wishes,
Richard