Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3664398
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:38:30+00:00 2026-05-19T01:38:30+00:00

I often build and modify databases from within Visual Studio 2010 Pro. I have

  • 0

I often build and modify databases from within Visual Studio 2010 Pro. I have VS set to prompt me after every change to save a change script, so that I have the scripting necessary to update the production DB when the time comes.

My issue with this is that the default directory for saving these files is always the ‘current directory’ when Visual Studio was started. That means it was originally the VS install directory, until I changed my shortcut to VS to at least pass my Visual Studio projects root directory.

But as a freelance developer working on various projects for various clients, my folder structure from there is still somewhat significant, so it’s usually more than just a single folder down from there I need to go.

One solution can be to open Solutions from their Solution files directly, since that passes the solution directory as current. However, I never do this; I start VS directly and typically load recent projects from the start page.


So, does anyone know a way to change the default location that VS will offer to save database change scripts? It’s not in the standard settings of VS; I imagine an add-in/extension could do something there, but I’m not aware of any which do, and I’ve not had enough experience working on extensions to have an idea how to do one myself.

Any help finding/creating an appropriate extension, or other hack, will be appreciated!

p.s. I really don’t want to earn a Tumbleweed badge off this question! heh


EDIT: I wonder; perhaps the angle to look toward is changing the ‘current directory’ based on the solution loaded?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:38:31+00:00Added an answer on May 19, 2026 at 1:38 am

    One point to note is you can use solution explorer and save database scripts without having a project loaded – which kind of suggests the path isn’t project related, but fixed to devenv itself and devenv will have to be reloaded to change the path. So as you suggested, you need to open the solution file directly – but for me, that still didn’t work, so I did a bit of batch scripting to make it work.
    This is my solution – I’ve tested it and it works

    Create a batch file – This is my version: Theres a lot of stuff that can be removed, but I’m sure you can tidy it up.

    @ECHO OFF
    
    REM this bit gets the directory from a parameter passed in as %1 - assuming %1 is a filename
    SET PT=%~p1
    
    ECHO %PT%
    
    SET PRJ=%1
    
    ECHO Project File:  %PRJ%
    
    SET HERE=%PT%
    
    REM GO to visual studio command prompt, right-clic get properties and path of vcvarsall.bat
    
    CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
    
    REM %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
    
    
    CD %HERE%
    ECHO %HERE%
    
    START devenv.exe %PRJ%
    

    Save the batch file.

    Go to your visual Studio Solution file that you want to open – right-click the .sln and select “open with …” navigate to the batch file – and open with that.

    It does mean you have to open your projects by right-clicking on the solution file, and not by using the in-built recent-projects list.

    Another possibility is to set an environment variable under windows for your project directory, (e.g. PRJ = C:\Documents and Settings\My User\My Documents\VS Projects) Then in the Save script dialog box, you can type %PRJ% to shortcut getting to your project folder.

    Not exactly what you wanted – but workable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see this often in the build scripts of projects that use autotools (autoconf,
I seem to run into this very often. I need to build a Hash
Often I find myself interacting with files in some way but after writing the
Often time I need to add a control to a dialog after the dialog
Quite often I have unit tests using MSTest for code that is in a
I have and old AV that hunts me. It appears randomly (often but not
I recently built an API and was often asked to replace the StringCollections I
Often while editing config files, I'll open one with vi and then when I
Often, I find myself wanting to write a unit test for a portion of
Often we need to add a non-nullable column to a table, and it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.