Monday, September 20, 2010

VBScript - Change your list seperator/delimiter

Depending on what I'm doing I like to change my list separator accordingly. Sometimes I need to create/open a .csv file except I don't want comma's to be the seperator in that file. Other times I do... So I decided instead of having to constantly go into the control panel and change my settings I just created two scripts. One with "|" as the list seperator and another with the standard comma.

What this script does exactly is goes into the registry and overwrites the current list separator with the one provided. Just change the highlighted value from a , to whatever you'd like.

const HKEY_CURRENT_USER = &H80000001
strComputer = "."
 Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strValue = ","
oReg.SetStringValue HKEY_CURRENT_USER,
Control Panel\International,sList,strValue

Of course this is just a standard registry string creation script so it can be modified to do endless things with. Get creative but please know what you're doing. Messing around in the registry can be nice, but it can also be very dangerous.

Windows XP or newer

As always all questions and comments are welcome and appreciated. Thank you and god bless.

No comments:

Post a Comment