Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Creating a USER DSN using a batch file?

Options
  • 03-05-2005 10:21am
    #1
    Registered Users Posts: 7,498 ✭✭✭


    Hi i jave just finished creating a java program that uses a MYSQL database and i need to automate the installation of a USER DSN to install this database on new computers. Does anyone know how i can do this via command line so i can enter it into a batch file?


Comments

  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    User DSN? As in ODBC? This info is stored in the registry.

    In XP, its \HKEY_CURRENT_USER\Software\ODBC\ODBC.INI

    Under this, you'll find ODBC Data Sources where there's an entry for each User DSN Name, and you'll also find a "folder" for each name with the relevant info set there.

    So, you can easily prepare a .reg file (export the entire tree from the point I mention above, and strip out anything which isn't relevant), which you can then merge with the registry from the command line ("regedit myfile.reg", or maybe just "myfile.reg" should do it).

    This isn't an ideal solution, I know, but its generally the best "quick and dirty" solution to this problem that I've found.

    jc


  • Closed Accounts Posts: 1,746 ✭✭✭0utshined


    Thanks for that bonkey.

    I had to do something similar in work today and remembered this post so I was Johnny great lad.


  • Registered Users Posts: 277 ✭✭Lawnkiller


    if you want a user-proof deployment method, you could always try something like old INNO setup (found here ). that'll copy your files into the right folders and allow you to script in some reg info too.


Advertisement