Scripting Blog

A place to learn about PowerShell and share stories of automation

Can I Create and Delete a DSN Using a Script?

Hey, Scripting Guy! Is it possible to create an ODBC Data Sources Name (DSN) on the fly and then remove it when done?-- KC Hey, KC. Is it possible to create and then delete an ODBC DSN? To tell you the truth, we weren’t entirely sure. As it turns out, however the answer is this: as long as you’re willing to write a script that modifies ...

Registry Script Doesn't Work

Hey, Scripting Guy! I tried writing a script to read data from the registry, but I keep getting this error:   Do you have any idea what's wrong? I'm running Windows XP Professional, Service Pack 1, and this is the code I'm using:Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set oReg=GetObject("winmgmts:\\" &_ ...