Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Create ODBC automatically using batch script at user logon Expand / Collapse
Author
Message
Posted Wednesday, February 20, 2008 10:02 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, October 3, 2012 6:35 AM
Points: 97, Visits: 501
Hi, Can anyone post me an example batch file (.bat) that will create a ODBC i.e. regedit, and allow me to change a value for a database in a software application key?? i know the keys i want to edit, as i have created these in other pragram wrappers..but are they the same when i run them through a batch file?

This script will run on logon for each user within a particular OU


My executable script section...


SectionEnd

Section "Create ODBC (NEW Installs Only)"

WriteRegStr HKLM "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources" "${ODBC_CONNECTION_NAME}" "SQL Server"
WriteRegStr HKLM "SOFTWARE\ODBC\ODBC.INI\${ODBC_CONNECTION_NAME}" "Description" "Test Log Connection"
WriteRegStr HKLM "SOFTWARE\ODBC\ODBC.INI\${ODBC_CONNECTION_NAME}" "Driver" "$SYSDIR\SQLSRV32.dll"
WriteRegStr HKLM "SOFTWARE\ODBC\ODBC.INI\${ODBC_CONNECTION_NAME}" "LastUser" "sysaudit"
WriteRegStr HKLM "SOFTWARE\ODBC\ODBC.INI\${ODBC_CONNECTION_NAME}" "Server" "d-ap50"
WriteRegStr HKLM "SOFTWARE\ODBC\ODBC.INI\${ODBC_CONNECTION_NAME}" "Database" "SysAudit"
WriteRegStr HKLM "SOFTWARE\ODBC\ODBC.INI\${ODBC_CONNECTION_NAME}" "Trusted_Connection" "Trusted_Connection"



SectionEnd


Oraculum
Post #458094
Posted Wednesday, February 20, 2008 12:42 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 5:18 PM
Points: 2,665, Visits: 836
Try experimenting with reg.exe. It should be installed with Windows by default. It is a command-line registry editing tool. Just run reg /? from a command prompt to get help.





Scott Duncan

MARCUS. Why dost thou laugh? It fits not with this hour.
TITUS. Why, I have not another tear to shed;
--Titus Andronicus, William Shakespeare
Post #458177
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse