Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vsvars32.bat ineffective - what's up?

Status
Not open for further replies.

RLMuller

Programmer
Mar 7, 2003
15
0
0
US
Hi All,

I wanted to be able to run csc.exe and use VS symbols within a newly opened Command window without having to run vsvars32.bat each time.

I double-clicked vsvars32.bat from a Windows Explorer window, then opened a Command window and entered the command csc. I got the error message: 'csc' is not recognized as an internal or external command ...

I appended the command C:\PROGRA~1\MICROS~1.NET\Common7\Tools\vsvars32.bat to C:\Windows\System32\AutoExec.NT. After rebooting, I got the same error when executing csc in a new Command window.

To test the command I had appended, I pasted C:\PROGRA~1\MICROS~1.NET\Common7\Tools\vsvars32.bat in the window and executed it. Then csc was successful.

My recollection is that under Visual Studio 6.0 within Windows 2000 Pro, I just ran vcvars.bat in a command window and had environment variables set in a way that them defined in every subsequent command window.

What’s a straight-forward way of using vsvars32.bat to populate the environment?

TIA,
Richard Muller
 
I got a command window shortcut under:

Start | Programs | Microsoft Visual Studio .NET | Visual Studio .NET Tools | Visual Studio .NET Command Prompt

The shortcut has this as it's target:

%comspec% /k "C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\vsvars32.bat"

Your path may be different if you installed VS.NET somewhere other than the default location. You'll probably also need to change the start location.

I also created a .cmd file to change directories to where my projects are stored, so after opening the shortcut, I just type "myproj" and it takes me there.

Chip H.
 
Thanks again, Chip, for your help.

I stupidly tried to use Command.com instead of Cmd.exe. And I probably used the /k switch sometime in the dim past, but I'll be damned if I can remember when.

In short, your advice worked perfectly unchanged.

Again, thanks. The thing was really bugging me!

Regards,
Richard
 
Hi Chip,

You may be interested that I got some additonal info from another forum: http, // :

There is a "Visual Studio .Net Tools" sub-menu of the Visual Studio menu that is installed; it contains a Visual Studio .Net Command Prompt item.

I plan on doing some training in C# in a few months (after I come up to speed), so I'm anxious in collecting a variety of answers to my questions.

Regards,
Richard
 
Thanks Richard -

I mentioned that in my post (first item, starting with "Start"). ;-)

Maybe I didn't make it clear that I got it by installing VS.NET (oops). Glad I was of some help.

When you get some time, take a look at C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin -- there are many utilities in there that don't have shortcuts created for you by the VS.NET installer.

Chip H.
 
You're absolutely right, Chip. I glossed over the first few lines and focused on the command and ran with it. You said it so gently, that I probably needed something like: "Look Stupid, Microsoft provided you a command to do just what your want. RTFM!" {BG)

I did notice that .../bin had a number of utilities and looked them over just now. I'll take a close look later, but right now I'm focusing on Web Forms, then DB, exception handling, threading, XML handling, Web Forms. I've got a busy program mapped out.

AS usual, thank you very much for your posts.

Best wishes,
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top