Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Creating a USER DSN using a batch file?

  • 03-05-2005 10:21AM
    #1
    Registered Users, Registered Users 2 Posts: 7,548 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 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
Advertisement