Create ODBC automatically using batch script at user logon

  • 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

  • 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


Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply