Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting ODBC Connection

Status
Not open for further replies.

dodge20

MIS
Jan 15, 2003
1,048
0
0
US
I am trying to script an odbc connection to multiple servers using odbcconf.exe and remote shell (rsh). I can't seem to make it work correctly. When I run the following script, it doesn't appear to do anything after it does the cmd.exe.

Code:
@echo off
setlocal

for /F %%G in (serverlist.txt) do (
rsh %%G cmd.exe
odbcconf.exe /Ln log.txt /a {CONFIGSYSDSN "SQL Server" "DSN=perfmon|Description=Perfomance Monitor on MyServer|SERVER=MyServer\sql1|Trusted_Connection=Yes|Database=MyDB"} 
exit
)

Any Ideas?



Dodge20
 
Use VBScript instead. You will find many samples with a quick google search for "create ODBC vbscript"



I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top