SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create ODBC automatically using batch script at user logon


Create ODBC automatically using batch script at user logon

Author
Message
oraculum
oraculum
SSChasing Mays
SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)

Group: General Forum Members
Points: 607 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
thecosmictrickster@gmail.com
thecosmictrickster@gmail.com
SSCarpal Tunnel
SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)

Group: General Forum Members
Points: 4646 Visits: 940
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

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search