Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I write batch file to copy folders from solution to another in visual studio 2013.

I wanna execute this file in build event by this code
CALL "..\CopyFilesToProducts.bat"


It gives me the below error
Error 41 The command "CALL "..\CopyFilesToProducts.bat"" exited with code 9009.
Posted

The most likely reason is that it's not a fully qualified path - it's a relative path, and I've seen this before as an intermittent problem with VS builds. Changing to a full path:
CALL "C:\MyApps\CopyFilesToProducts.bat"
should cure it.

I suspect that the "current folder" that VS uses as the starting point for the relative path specification depends on the last operation it needed to do as part of teh actual build operation, but I'm not sure.
 
Share this answer
 
Comments
Richard Deeming 14-May-15 8:39am    
Since the path seems to be relative to the solution, it would probably be a better idea to use the available path placeholders - for example, $(SolutionDir).

That way, the build won't break if you move the solution to a different path. :)
I am sorry because after I search and trace I found that,
I don't have problem with Visual Studio my problem was in cmd on local user environment variable ,

I found two solutions for this issue :
1 - Open Visual Studio as administrator

2 - changed local user environment variable path

right click on My Computer > Properties > Advanced System Setting > environment variable > Path [Edit value to C:\Windows\System32; ]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900