PostBuild Event : Retrieving Environment Variable

  • Thread starter Thread starter Shahzad Atta
  • Start date Start date
S

Shahzad Atta

Hi there,

I am using a batch file to do some zipping task. This batch file get
executed on postbuild event which I set through project properties. Now
when I execute the batch file from command prompt (System Or Visual
Studio.Net) I get the desired behavior. But when I Build the project I am
not getting the desired result.

The batch file includes a if statement which checks an environment variable
and takes the desired action the statement is of the following pattern

If "%XYZVariable%" == "False" goto Label1
XCopy ...
exit 1
:Label1
XCopy2 ...
exit 1

Now what I think is that visual studio is unable to retrieve the
XYZVariable. I added that variable in system Environment variables as well
as vsvars.bat file. Any clue ?? May be I am doing some thing wrong

the postBuild event has the following command run "C:\ABC.bat".

Any help will be appreciated.

Regards,

Shahzad Atta
 
I would test this by making a batch file that only prints few
environment variable values that are needed.
 
Back
Top