473,473 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Build Script?

Hello, Newsgroupians:

In Visual Studio 2005, I have a project that I continually build and run
over and over. However, it also has external dependencies, which are three
other files in another directory on my computer. Is it possible to tell
Visual Studio to go grab these files before you begin running and place them
in the run directory, so I can make my code system independent [IE: Instead
of specifying the entire path for the file, I can just do @".\<filename>"]?

I change the three other files continually, and I'm not in the mood to open
Windows Explorer and copy and paste the files in the bin\Debug or
bin\Release. I would hard code the directory in the code, but I'm trying to
get away from it being system dependent. Thank you.
Trecius
Oct 25 '07 #1
3 2528
1) Add the file to the project.

2) Right click on the file.

3) Under "Copy To Output Directory" select the option that best fit you such
as "Copy if newer".

"Trecius" <Tr*****@discussions.microsoft.comwrote in message
news:C1**********************************@microsof t.com...
Hello, Newsgroupians:

In Visual Studio 2005, I have a project that I continually build and run
over and over. However, it also has external dependencies, which are
three
other files in another directory on my computer. Is it possible to tell
Visual Studio to go grab these files before you begin running and place
them
in the run directory, so I can make my code system independent [IE:
Instead
of specifying the entire path for the file, I can just do
@".\<filename>"]?

I change the three other files continually, and I'm not in the mood to
open
Windows Explorer and copy and paste the files in the bin\Debug or
bin\Release. I would hard code the directory in the code, but I'm trying
to
get away from it being system dependent. Thank you.
Trecius

Oct 25 '07 #2
I am such an idiot :)

Never mind my previous post.

You may however look under the project properties and the "Build Events" tab
(Pre-build event command line), there you may be able to call a little
program that does what you need. Alternatively, you may just want to add the
code on your startup function to do what you need to do .
Oct 25 '07 #3
Trecius wrote:
Hello, Newsgroupians:

In Visual Studio 2005, I have a project that I continually build and run
over and over. However, it also has external dependencies, which are three
other files in another directory on my computer. Is it possible to tell
Visual Studio to go grab these files before you begin running and place them
in the run directory
I guess you want to create a pre-buuild script.. I don't have VS at hand
but you can define a command or a list of commands that will be executed
just before or after compilation. Just write a .bat file that copies
your files too the desired destination. There are some environment
variables too that you can use.

Another solution is to define the "copy local" property for the
reference files; set them to true. The files should be copied
automatically to your executable.

HTH,

Sebastian
Oct 25 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Shawn Wilson | last post by:
Hi, My host keeps messing things up and not telling me. I am trying to write a cron job that will test to make sure the "unusual" functions I use work and, if not, email me. I want it to send...
1
by: Ruchika | last post by:
Hi, I want to build an embedded Visual C++ project from the python script. This is what I do - evc = r'"C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\Bin\EVC.EXE"' proj =...
0
by: Scott Auge | last post by:
I created this script to help make zip files for software distributions. It will: -- Create a build number -- Create a VERSION file so people know which build they have -- Update the...
8
by: Mav | last post by:
Hi, all I wonder is that any way to estimate the build time from VS.net(C++ project). We have a lot of projects(40) under one single solution. We use the command line (devenv.exe...
6
by: Ivan Demkovitch | last post by:
Hi! Here is my problem: I'm inserting script for Trust Logo from one of the SSL authorities. It works fine when I do it in HTML, but I need to build it dynamically: HtmlTableRow tR = new...
12
by: David Murmann | last post by:
hi all! i just built revision 41809 under winxp using a rather uncommon setup (at least i think so). since i have no visual studio here, i only used freely available tools: cygwin to get the...
1
by: Matt Fielder | last post by:
I need to customize the build process beyond just selecting which projects get built in what order. What I want to happen is when I select "Release" 1: Pop a dialog confirming I want to build...
7
by: Mariusf | last post by:
I am a novice Perl programmer and need to change a perl script that I use to create web pages with thumbnail images and some text. Currently the script created a web page for each artist / category...
1
by: =?Utf-8?B?dG9t?= | last post by:
Hi, I would like to create a script (.bat file) so that I can right-click on a ..sln file and have the extra option "Build" in the menu so that I can execute a build without opening the solution...
3
by: tvnaidu | last post by:
This is my build script, I calls this script from main build script, in case of SUCCESS, everything is ok, but in failure, I do "return 1", so that main build can cheque "$?" and based on that it...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.