Re: creating a dsn in script

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Steve Seguis [MVP] (steve_NO_SPAM_at_scriptmation.com)
Date: 12/09/04


Date: Thu, 09 Dec 2004 22:32:22 GMT

The easiest way is to create the DSN on one machine, then go into the
registry and export these settings.

For User DSNs, look in:
HKEY_CURRENT_USER\Software\ODBC\ODBC.INI

For System DSNs, look in:
HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI

Just right click on the key under the ODBC.INI key that pertains to your DSN
and export to a reg file. You can then import it in another machine by
running:

regedit /s C:\dsn.reg

Where C:\dsn.reg is the path and filename for your reg file. Note: This
assumes that whatever ODBC provider your DSN is using also exists on the
other PCs.

Hope that helps.

-- 
Steve Seguis - MCSE, MS-MVP, SCJP
SCRIPTMATION
Automating the Enterprise
http://www.scriptmation.com
"Dan D." <DanD@discussions.microsoft.com> wrote in message 
news:77D469F9-29EB-4CB7-BA9A-D99512B4CD4F@microsoft.com...
> Is it possible to create a dsn on every PC we have in script? I thought I 
> saw
> an example somewhere about a year ago but now I can find anything on it.
>
> Thanks,
> -- 
> Dan D. 


Relevant Pages

  • Re: how to tell if a computer is logged into network
    ... > Ray at work ... >> I want to create a dsn on each computer and copy a file. ... >> though my computer is logged in to the network. ... >> Dan D. ...
    (microsoft.public.windows.server.scripting)
  • how to tell if a computer is logged into network
    ... I want to create a dsn on each computer and copy a file. ... Set oSWbemLoc = CreateObject ... 'Exit Do ... Dan D. ...
    (microsoft.public.windows.server.scripting)
  • Re: how to tell if a computer is logged into network
    ... Ray at work ... > I want to create a dsn on each computer and copy a file. ... > 'Exit Do ... > Dan D. ...
    (microsoft.public.windows.server.scripting)
  • Re: Export ODBC?
    ... "System/User DSN" and store it on a network share, this way if you ver need to use ODBC connection ... So if you export this node to a *.reg file and run this reg file on a target machine, ...
    (microsoft.public.sqlserver.odbc)
  • Re: Change servername based on logon server
    ... maybe a File DSN would be a more secure bet? ... short application to the logon script that only touches the registry keys ... Yes the server name is stored in the HKCU. ... We propose to use a reg file attached to a logon script to amend the ...
    (microsoft.public.sqlserver.odbc)