Remove odbc system dsn using batch file and odbcconf

I create user system dsn entries by using a batch file and odbcconf call.  I've found references here on how to do that, yet cannot seem to find any results on how to remove them using that same call.  The library information (http://msdn.microsoft.com/en-us/library/ee388579(VS.85).aspx) states add and modify a system dsn for configdsn and configsysdsn and references equivalent to SQLConfgDataSource function. (http://msdn.microsoft.com/en-us/library/ms716476(VS.85).aspx) but the config data source function has a a removal and this doesn't seem too. 
Apologies for being obtuse, but I can't seem to locate it.  Any links to how this is done from a batch file are much appreciated.
Regards,
NR.

John C is basically correct, you can remove a System ODBC data source via the registry, but there is apparently no way via odbcconf.exe.  That is of course really stupid and poor programming!
John, however, forgot another important registry entry.  That key deletion he mentioned will disable the odbc connection, but not remove it entirely.  If you just do that and then open the "ODBC Data Source Administrator", you will find the
connection is still listed, but you can't remove it or modify it.  It becomes completely screwed up! There is a value to delete as well which dictates if the connection is listed.  Consider it the "header" to the data source.
Also, in Windows 2003 and 2008 at least, the registry key John C listed is not quite the location to modify either.  This is where to find them in those OSs:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DSN%
or
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DSN%
The "header" I reffered to is a string value in inside a key (not the whole key!)
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
or
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources
The string value is the data source name.  This entry must be removed to remove the data source listing entirely.
Here are some batch snipets for creating and then removing an odbc data source.  I'm leaving out some premiliary chunks, but you can figure it out from here. If you can't, you probably shouldn't be messing with this stuff in the first place!
In these scripts, I create and remove a 32-bit data source in either a 32-bit or 64-bit version of windows.  The windows folder variable gets set to either "C:\Windows\System32" or "C:\Windows\SysWOW64" depending on the os.  In case you didn't
know, on a 64-bit machine there is are also 2 differrent versions of the "ODBC Data Source Administrator" gui tool and the data source lists differ (32-bit vs 64-bit lists).  The 32-bit version on a 64 bit OS is found at "C:\Windows\SysWOW64\odbcad32.exe". 
The one in the start menu will load the 64-bit version so you will never find your 32-bit connections there.
Note - for simplicity I use the database name as the user name and and the data source name as well (in case there was any confusion). 
Create the connection like so:
echo Creating 32-Bit System ODBC Connection "%DatabaseName%"...
"!WindowsFolder!\ODBCCONF.EXE" CONFIGSYSDSN "!ODBCDriver!" "DSN=%DatabaseName%;Server=localhost;Port=3306;Database=%DatabaseName%;UID=%DatabaseName%;PWD=%DatabasePassword%"
And then remove it like this:
echo Removing 32-Bit System ODBC Connection "%DatabaseName%"...
if "%WindowsBits%"=="32" (
If Exist "!TempRegFile!" Del "!TempRegFile!"
echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
echo.>>"!TempRegFile!"
echo [-HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
echo [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
echo "%DatabaseName%"=->>"!TempRegFile!"
regedit /s "!TempRegFile!"
) else (
If Exist "!TempRegFile!" Del "!TempRegFile!"
echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
echo.>>"!TempRegFile!"
echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
echo "%DatabaseName%"=->>"!TempRegFile!"
regedit /s "!TempRegFile!"
If Exist "!TempRegFile!" Del "!TempRegFile!"

Similar Messages

  • Compile and run java programs using batch file

    i am using eclipse to run my java programs.How to compile and run those programs using a batch file?

    a) just write a batch file, and add it to the project. When you want to run it, go to a command window and invoke it. (There is probably also a way to invoke it from Eclipse)
    b) if the project is complicated, take a look at ant. Eclispe knows about ant files.

  • How to use batch files to send the load from ODC to UCM?

    Hello all.
    We're trying to do this along this week and, until now, we couldn't figure out how to use batch files containing metada on ODC and commit the output files to UCM.
    So these are our specs:
    VM 1
    ODC - 10gR3
    OS - Windows XP 32 bits SP3
    DB - Oracle DB 11.2
    VM 2
    No ODC
    UCM 11.1.1.6
    OS - Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
    We've opened a ticket with Oracle Support to know how we should do this. The number is SR 3-6108348211.
    Let me try to explain what we want to do:
    1 - we have a batch file with all metadata of many files from UCM
    2 - we want to use this file in ODC, so the application will convert the images and commit them to UCM
    3 - we should see all these files, their metadata, thumbnails and related content in UCM
    4 - this is a batch file example we want to send to ODC:
    @Properties LocalData
    IdcService=CHECKIN_UNIVERSAL
    dRevLabel = 1
    primaryFile=/tra/Relatorio_UHPF-03-04-2008-M-RL-EA.pdf
    dDocName=TRA_33
    dDocTitle=UHPF-03-04-2008-M-RL-EA
    dSecurityGroup=MAM_TRA
    dDocType=Document
    dDocAuthor=luis.neotropical
    dInDate=14/05/08
    xC_CLASSIFICACAO=EA - Educação Ambiental
    xC_DATA=01/04/08
    xC_DATAVALIDADE=30/04/08
    xC_LOCALIZACAOFISICA=N/D
    xC_USUARIO_DEP=LUIS FERNANDO DA CAMARA
    xC_TIPO=RL - Relatório
    xC_USINA=UHPF - USINA HIDRELÉTRICA PASSO FUNDO
    xC_FICHA=MAM - Relatorios Ambientais
    xC_IDDOCMAN=TRADocID=157
    xC_IDANEXODOCMAN=TRAFileID=33
    xC_DESTINOINICIAL=Tractebel
    xC_ORIGEM=Neotropical
    xC_FORMATODOCUMENTO=Digital
    xC_GENERODOCUMENTO=
    xC_DOCPRINCIPAL=Sim
    @end
    <<EOD>>
    5 - So, when we use this batch file on ODC, the file (or image) will be converted, all metadata attached and then sent to UCM.
    But we don't know how to do the link between ODC and UCM. The Oracle Support says it is necessary to do some customization. In the books I could not find any info about how to do, just generic information or how to use ODC.
    Is there a way (without customization) to do that? Can anyone give us a step-by-step guide?
    Thanks for all help and guidance.
    Fernando

    What is the one-sentence requirement or issue you're trying to solve?
    If you only want content to be converted to pdf, then you should already have that with your items checked into UCM (if you have IBR enabled).
    if you really want to feed content into ODC using a batchfile, my first thought would be to create a transformation utility/app that will convert your batchfiles to the expected ODC import server folder job format. then you'll have to move or map the content to match.
    Again, without knowing the exact issue/business requirement you're trying to work through, I'd say a redesign of your ingestion process may be in order.
    If you feed content directly into ODC through any supported ODC method (watch folder, email, scanner, fax, etc), then you'll be able to use everything ootb as you'll be able to auto-commit directly into UCM or add an indexing step and manual commit to UCM.
    ODC is basically a front end for indexing and extra ingestion options to your content repo.
    IPM is basically the same, but it includes some extra process-related details (process metadata, process integrations/bpel/bpm, other system integrations/ebs/crm, etc). I don't feel that IPM would help with the transformation-specific question you've put out there.
    -ryan

  • Open vi file with specific Labview version using batch file (Windows)

    I want to open certain vi with using Windows batch file and to use specific version of Labview development system. I tried
    "C:\Program Files (x86)\National Instruments\LabVIEW 2012\LabVIEW.exe" "path_to_vi"
    "C:\Program Files\National Instruments\LabVIEW 2012\LabVIEW.exe" "path_to_vi"
    to use 32-bit and 64-bit development systems respectively. However Labview opens file with version which was last used before. Are there any ways to force it use specified version?

    No, it's a VI I wrote so that when I open any VI from Windows Explorer it will open it in correct version of LabVIEW according to it's source version (rather than the latest/last version of LabVIEW I opened). All it does to launch the right version of LabVIEW is to call System Exec with the path to the correct version of the LabVIEW.exe and the path to the VI - which is essentially the same as what your batch file is doing.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Music and Video on Nas in folders but how do i set up itunes on multiple computers to see and use these files and create libraries?

    Music and Video on Nas in folders but how do i set up itunes on multiple computers to see and use these files and create libraries?
    So i have had a itunes set up on my old PC, bought a NAS and copied the folders over to the NAS, i did this incorrectly and so then even when i told the old PC to use that folder it saw all the songs but wasnt able to play the songs as it was looking in the incorrect place.
    So now i want my Mac as well as my PC and others to all use the music, videos etc on the NAS they are in itunes friendly folders (as they were compiled this way by the itunes on the old PC.
    When i tell the mac to use the itunes library.itl file it sees the song list (about 100gb) but cant see any songs, so i have removed this file to another location for now with the hope to set up a new file and then get it to see the songs on the folder from the NAS.
    Can someone tell me how to do this for all the Mac's and PC's on my network as i really want one master library that all use and add too.
    Thanks for your help in advance.

    I have the same question but I am using two pc's

  • Setting up ODBC System DSN

    I have successfully installed the Oracle 8.1.7.3.0 ODBC driver (through the Universal Installer) on a Win 2000 Pentium 4 pc. When I attempt to add a new System DSN using the installed Oracle ODBC driver, as soon as I select "Oracle in DEFAULT_HOME", I get the following error message... "The setup routines for the Oracle in DEFAULT_HOME ODBC driver could not be loaded due to system error code 126."...any ideas???? I am using Microsofts standard Microsoft ODBC for Oracle to access a few 8.0.5.2.0 databases, but when I try using that same driver to access the 8.1.7.3.0 database, I can only access 1 table from any schema. Help!!! I read elsewhere in this forum that the driver installed must match the Oracle client software version. If this is true, how do I determine what version my client software is (my SQL*Plus version is 8.0.5.2.0). Any recommendations?
    Thanks!
    Torrey

    It sounds like you have an 8.0.5 Oracle client. Try using the 8.0.5.x ODBC driver.
    Justin

  • I have created a user in oracle BPM but it is not reflected in system-jazn-data.xml file and I am unable to authenticate that user to create context as needed in workflow client

    I have created a user in oracle BPM but it is not reflected in system-jazn-data.xml file and I am unable to authenticate that user to create context as needed in workflow client

    weblogic credentials are different.
    and using thode credentials I am able to login to weblogic server
    the users I am talking about is the process users defined in realm.
    in realm those users are defined as Default authenticator and OID authenticator.
    and I am trying to authenticate one of those users defined in realm using java api so that I an access a process defined In Oracle BPM 11g

  • Rman backup fails on windows when using batch file

    Hello Gurus ..
    I am trying to setup incremental backup on my windows OS based server using RMAN command in batch file. When I use batch file in OS scheduler it is working fine, when I am calling same batch file from my LOCAL desktop PC it throws errors as below.
    D:\> \\3.193.211.19\sgdba\rman\bkp_acressit.bat
    D:\>rman catalog rman/******@acressit target / cmd
    file=E:\sgdba\rman\bkp_arch.rcv log E:\sgdba\rman\sit_arch_rman_backup.log
    RMAN-00557: could not open MSGLOG "E:\sgdba\rman\sit_arch_rman_backup.log"
    Argument Value Description
    target quoted-string connect-string for target database
    catalog quoted-string connect-string for recovery catalog
    nocatalog none if specified, then no recovery catalog
    cmdfile quoted-string name of input command file
    log quoted-string name of output message log file
    trace quoted-string name of output debugging message log file
    append none if specified, log is opened in append mode
    debug optional-args activate debugging
    msgno none show RMAN-nnnn prefix for all messages
    send quoted-string send a command to the media manager
    pipe string building block for pipe names
    timeout integer number of seconds to wait for pipe input
    checksyntax none check the command file for syntax errors
    Both single and double quotes (' or ") are accepted for a quoted-string.
    Quotes are not required unless the string contains embedded white-space.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00556: could not open CMDFILE "E:\sgdba\rman\bkp_arch.rcv"
    Contents of the batch file and RCV file as below:
    Batch File:
    rman catalog rman/*******@acressit target / cmdfile=E:\sgdba\rman\bkp_arch.rcv log E:\sgdba\rman\sit_arch_rman_backup.log
    RCV File:
    RUN {
    ALLOCATE CHANNEL ch1 TYPE
    DISK FORMAT 'E:\ORA_RMAN_BACKUP\ARCH_%d_%u_%s_%p';
    BACKUP ARCHIVELOG delete input;
    RELEASE CHANNEL ch1;
    EXIT;
    --------------------------xxxxxxxxxxxxxx------------------------
    * on my DB server I am login using my administrator account, on my PC I dont have admin account.
    * I have checked remote execution using local user as well as admin user.
    * I have checked the permission and my local ID & EVERYONE has all permission in that folder.
    Any help will be appriciated.
    Thanks & Regards
    Ashish

    Ashish wrote:
    hi Atil,
    u have guessed it correctly, I came to know that issue later I copy file on local PC and it works fine.
    Now I am working on netbackup server. I want to use the same script to initiate backup from netbackup server. Do you have any idea or any guidelines from you will appriciate.
    Thanks
    AshishAshish,
    Is it "symantec's netbackup"? I do not know that product and if it has an option to enter your own RMAN scripts. On the other hand, it should be able to create irman scripts according to your backup job definition.
    Regards
    Gokhan

  • Problem on using batch file

    Hi,
    I have an application which reads data from a text and writes them to a database. I should use batch files in my project to work classes with double clicking on them. Java application reads path of the text file from a properties file. I used relative paths like that " ..\\data\\records.txt" for text file path . But my problem is that; when I run application normally it executes. But when I tried to run it from batch file placed build folder(under project folder) it does not work. Because it tries to find the data folder under the build folder. But data folder is under parent folder of build folder. My batch file code is like that :
    SET PATH=%JAVA_HOME%\bin;%PATH%
    SET LIB_PATH=..\lib
    SET CLASSPATH=%LIB_PATH%\mysql-connector-java-3.0.17-ga-bin.jar;..\bin;..\
    java.exe yega.timesheet.MainApplication ..\\configuration\\properties.props
    pause
    Which statements should I add(and where) to make this batch file search for data folder under its parent folder... Please help me.
    Thank you.

    Thanks Paul, but I tried to use cd before running program. I added "cd .." or "cd ..\" lines to batch file but they didn't work. I decided to use absolute path instead of using relative paths. I also found one more solution. I can put a properties file in build too. And define text path as " ..\\data\\records.txt " in this properties file.
    Also I need to use "\\" because "..\\configuration\\properties.props" is the input for args...

  • Call ggsci using batch file from windows- get error

    i create a script to use ggsci, start manager, extract and replicat.
    i have success doing this in my linux.
    here is one of my script : start_ext1.sh
    cd /u01/app/oracle/ggs
    ./ggsci <<EOF
    start manager
    start ext_s
    exit
    EOF
    clear
    i have an error when i do this using batch file from windows.
    here is the batch file :
    @echo off
    cd C:\putty
    plink.exe -ssh -2 -P 22 [email protected] -pw oracle "./start_ext1.sh"
    every time i try to enter ggsci when i run that batch file, i get this error :
    ./ggsci: error while loading shared libraries: libnnz10.so: cannot open shared object file: No such file or directory
    i didn't get this error when i run the script in linux.
    is there anybody can help me?
    thanks a lot!

    problem solved!
    add : . ./.bash_profile before enter ggsci.
    it's worked! :)

  • Crystal Reports Schedule using Batch File

    Hi,
    I am trying to automatically export Crystal Reports using a Batch file and Windows Task Scheduler. It sucessfully opens Crystal, but doesn't perform the export.
    "C:\Program Files\Business Objects\Crystal Reports 11.5\crw32.exe" "C:\reportname.rpt" /X 36 /D 1 /FN "C:\report export name.xls"
    Any help would be greatly appreciated.
    Thanks,
    Nick
    Edited by: NickHofmeyr on Apr 26, 2010 11:22 AM

    Hello,
    Sorry but CR doesn't support command line running of reports. You can use Crystal Reports Server, Businessobjects Enterprise or some third party tool that uses Crystal runtime.
    Thank you
    Don

  • Can I remove photo shop 3 using windows add and remove after transfering photos to elements 10

    can I remove photo shop 3 using windows add and remove after transfering photos to elements 10. Will I lose any of these photos in elements 10?

    Yes you can remove it and your photos will not be removed. Un install it from add or remove or from the start menu.

  • I am writing an interactive book and want to use media files and stuff.

    I am writing an interactive book and want to use media files and stuff. My question is: If I want to sell this book in the iBookstore,
    may I use photos I find on google images and media i find on youtube? Or must all be my own stuff?

    No !  well not just any photo image or "media". The person who created the photo images has a copyright protection IF  he/she wishes to impose it - ditto video and other  media.
    However if its out of copyright by  virtue of age and certain other factors - its considered in "The Public Domain" which is why you see paintings by the Impressionists all over chocolate boxes and posters to name but two!
    There are websites offering images donated by the creators and all for free.
    Taking and using a picture you do not own copyright and placing online where it can be downloaded is  first "publishing" and you  need permission and placing in a situation where it can be copied and re-distributed is a breach of copyright.
    Look at the  tail end credits on any DVD...  the above is always  included.
    Others rmay  correct me but Copyright in some countries is vaild from creation until 50 years after the death of the creator. However, that is not always the case.  Example, assume I am bequeathed a photo archive and on the  last day year 50,  I  publish a completely new version of the archive, wizzed through Photoshop, cleaned, cropped and modified in other ways.. then I can assert my claim for copyright of the renewed archive, but its a bit more complicated!!!
    You can search for "Free Photo Images (  media) , or royalty free images and if you land on a particular website you can ask permission. If you send me a request, my reply will be NO... and you get a warning of dire consequences if your infringe my copyright!  Other may be more lenient and in fact feel pretty good to be  asked.
    A way to get some guidance is to check out Wikipedia and the many  images included in its subject matter, check out the copyright status.
    Beware of using  photo images of paintings in  Galleries and Museums, they may have copyright conditions.. but one can always contact them to seek  permission.
    Search  for  Copyright and ownership and it should bring up some good information. Depending on your country.. it may have its own  Copyright website. USA are more detailed than most, The UK has the 1988 Copyright Act.
    Also remember that all photo images carry exif embedded data which  among other things carries the copyright information and shows up in a google search for the right  keyword!  Scanned images processed through Photoshop and other editors  can have the metatdata added also.

  • Batch file and PKZIPC utility

    I call a batch file from Oracle forms by clicking on a button. The batch file calls pkzipc utility to extract the contents of a zip file, and place it in the destination xyzfolder. However, this is not working.
    The batch file and PKZIPC are located on the same server. When I run the batch file on the server, pkzipc utility works fine. When I call the batch file from Oracle forms, then the utilty is not working.
    When-button-pressed trigger has the following code:
    declare
    the_command varchar2(2000) := '\\ABCserver\ABCfolder\abcd.bat';
    begin
    host(the_command);
    message('done');
    end;
    batch file code :
    cd "\\ABCserver\c$\Program Files\PKWARE\PKZIPC"
    pkzipc -extract -silent -nofix -overwrite -directories -logfile \\ABCserver\c$\xyzfolder\26.zip \\ABCserver\c$\sssfolder
    exit
    How do I resolve this ?
    Thanks
    SR

    The HOST command likely does not have permission to access a file across a network share. This is probably a Windows restriction and has nothing to do with Oracle. Windows Services do not have permission to access shares. Because Forms is a child process to OPMN (which run as a Win Service) the HOST executed from Forms is probably restricted too. For testing to prove this theory, put all the files on the Application Server and it will probably work correctly. Of course the batch code will need to be changed to reflect the local drive and directories.

  • Run Form using Batch file

    Hiii
    how can run a form using batch file (.bat) .. .
    ???

    i forget to say that am using Developer 10g R2 ...
    another question is what should i start when using the batch file other than the
    OC4J instance .....

Maybe you are looking for

  • OCI Function call vs Odatabase Class

    In my application I've used ODatabase class to open a database connection. At the same time, I use OCI function calls method to connect to the same database. This is use to execute store procedure & query. My question is that does it cause double con

  • Apple password not recognized on new macbook pro

    I just bought a new macbook pro and used my time machine disk. All went fine until a message appeared that a device was incorrectly ejected. I clicked the message away and the transfer seemed to continue althpugh it suddenly needed twice the time as

  • Can't open after the apple logo

    unable to continuosly open my ipad3, just stock up just with the apple logo and it turns off again.

  • PCUI: Setting system status in sales documents

    Hi experts! For sales documents (e.g. Quotations, Complaints) in PCUI, we lack the possibility to enter the system status. In PCUI, only the user status can be changed. In SAP GUI, both system and user status can be set. For replication issues, we ne

  • Weblogic - Development Mode - Alias

    Hi! I´m trying con configure my standalone weblogic (10.3.6), running in development mode, to find my forms 11 applications icons without use a jar file. So, at formsweb.cfg i changed imageBase to documentBase and at Registry.dat i set default.icons.