Batch File to Remove ODBC Connection

I've figured out how to create an ODBC connection through a batch file that
runs like this:

ODBCConf ConfigSysDSN "MySQL ODBC 5.1 Driver" "DSN=test;SERVER=cpucnd1277xr9.mycompany.com;UID=%USERNAME%;PWD=today123;DATABASE=arms;PORT=3306"

Open in new window


I'm trying to figure out how to delete this connection through the same process.
Thanks,
-JW
LVL 1
JustinWAsked:
Who is Participating?
 
johnb6767Commented:
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<DSNNAME>" /f

All you need to do. HKCU for a User DSN....
0
 
coolfigerCommented:
0
 
coolfigerCommented:
i believe u jsut need to use the instodbc utility and write the necessary code in a batch file
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
JustinWAuthor Commented:
The delete portion of the batch file is going to be run by a lot of different computers.
Is instodbc a native windows utility?
0
 
johnb6767Commented:
Reason I suggested that, was is that its just a simpler method, instead of the above.....
0
 
JustinWAuthor Commented:
@john,

How to remove from //ODBC Data Sources?

When I go to odbc source admin, it still lists 'TEST' as an active ODBC
0
 
johnb6767Commented:
Should be gone after a reboot.....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.