Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 09, 2013 11:26 AM by bekker
Member
33 Points
30 Posts
Dec 30, 2012 02:06 PM|LINK
Hi,
I have this line of code as the pre-build event command line in Visual Studio 2012:
call "$(ProjectDir)Deployment\CopyFiles.bat"
The batch file just contains a comment so far, but I can't even execute it. This is the result when trying to deploy:
The command "call "F:\Website\Website\2013-3\Local\Website\Website\Deployment\CopyFiles.bat"" exited with code 1.
I have tried it without quotes, without "call" and I tried putting the batch file directly in F:\, all resulting in the same error.
How can I best do this?
Thanks!
All-Star
31764 Points
6492 Posts
Dec 31, 2012 12:07 AM|LINK
http://codebetter.com/brendantompkins/2004/05/13/run-a-bat-file-from-asp-net/
Dec 31, 2012 07:53 AM|LINK
Thanks for your reply, but I'm not trying to execute a batch file from code. I need to execute it in the pre-build event. In VS 2012: Project properties - Compile - Build Events - Pre-build event command line.
Jan 04, 2013 02:50 PM|LINK
Sorry to bump this one, but is there someone from Microsoft who can help me out?
I'm sure there must be a simple solution to this, but I wouldn't know what I should do different.
Jan 09, 2013 11:26 AM|LINK
I found the solution. In short: do not edit batch files in Visual Studio, and do not use Visual Studio variables in batch files.
The full story is here.
bekker
Member
33 Points
30 Posts
Cannot call batch file from pre-build event command line (VS 2012)
Dec 30, 2012 02:06 PM|LINK
Hi,
I have this line of code as the pre-build event command line in Visual Studio 2012:
The batch file just contains a comment so far, but I can't even execute it. This is the result when trying to deploy:
The command "call "F:\Website\Website\2013-3\Local\Website\Website\Deployment\CopyFiles.bat"" exited with code 1.
I have tried it without quotes, without "call" and I tried putting the batch file directly in F:\, all resulting in the same error.
How can I best do this?
Thanks!
oned_gk
All-Star
31764 Points
6492 Posts
Re: Cannot call batch file from pre-build event command line (VS 2012)
Dec 31, 2012 12:07 AM|LINK
http://codebetter.com/brendantompkins/2004/05/13/run-a-bat-file-from-asp-net/
bekker
Member
33 Points
30 Posts
Re: Cannot call batch file from pre-build event command line (VS 2012)
Dec 31, 2012 07:53 AM|LINK
Thanks for your reply, but I'm not trying to execute a batch file from code. I need to execute it in the pre-build event. In VS 2012: Project properties - Compile - Build Events - Pre-build event command line.
bekker
Member
33 Points
30 Posts
Re: Cannot call batch file from pre-build event command line (VS 2012)
Jan 04, 2013 02:50 PM|LINK
Sorry to bump this one, but is there someone from Microsoft who can help me out?
I'm sure there must be a simple solution to this, but I wouldn't know what I should do different.
bekker
Member
33 Points
30 Posts
Re: Cannot call batch file from pre-build event command line (VS 2012)
Jan 09, 2013 11:26 AM|LINK
I found the solution. In short: do not edit batch files in Visual Studio, and do not use Visual Studio variables in batch files.
The full story is here.