Reputation: 60731
I would like either a command prompt solution or a Visual Studio 2008 solution for the following:
I am building a solution in Visual Studio 2008 C# and I need to test it.
In order to test the solution, I need to copy it to a different machine.
My process is:
I try to do it like this:
rmdir s:\debug /s /q
s:
md debug
copy "C:\Documents and Settings\user123\Desktop\eFormsSystem\eFormsApp\bin\Debug\*.*" s:\debug\
however it is saying that THE SYSTEM CANNOT FIND THE PATH SPECIFIED.
I am certain there is a problem with the code above; however I would like to know:
Upvotes: 0
Views: 575
Reputation: 66
There are two things you can try. First is try using the switches on the copy command like you did for the rmdir command. Try adding the /Y and /Z switches.
May just want to try this first. I know the /Y is redundant since you are removing the destination directory before copying.
copy "C:\Documents and Settings\user123\Desktop\eFormsSystem\eFormsApp\bin\Debug\*.*" s:\debug\ /Z /Y
Secondly, you asked if you could do this from Visual Studio. You could use the post-build event on the project to copy files to another location on the network after a successful build. However, you first need to get the command working.
Upvotes: 1
Reputation: 10988
Your statements appear to be correct, and I tested that they work fine given a project that I have on my local machine. Is it possible that the user that you're running the statements from does not have permission to read from the folder in your "copy" statement? You can verify this by substituting the following for the copy line - ensure that it responds with a list of the files that you're intending to copy:
dir "C:\Documents and Settings\user123\Desktop\eFormsSystem\eFormsApp\bin\Debug"
Note that from within Visual Studio, you can add a "Post Build Event". Go to the Properties of your Project in Visual Studio (right-click on the Project and choose Properties). Then click the Build Events tab - on that tab you can enter command-line statements to run before and after the project is built. Click "Edit Post-build..." to bring up a window with Macros that you can insert into your script including things like "OutDir" which is the directory that the project output is written to.
Upvotes: 1