Replacing ';' with '|'

(imported topic written by wnolan91)

I have an issue where I’m pulling something like the %path% string. And the ‘;’ separator is messing up my script, or the backend… of a script which uses ‘;’ delimited values to mean different things… i.e.

value1; value2a|value2b|value2c; Computer Name; IP address value1|IP address value2|IP address value3; etc…

So one of the value2’s is a environmental var that pulls back which is seperated by ; which is messing up the logic. So ideally I would like to pull back the value of PATH

FROM

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files (x86)\QuickTime\QTSystem;

C:\Program Files (x86)\Enterprise Vault\EVClient;C:\Program Files (x86)\Voltage Security\Voltage SecureMail;C:\Program Files (x86)\Common Files\Voltage Security;C:\Program Files\Voltage Security\Voltage SecureMai

l;C:\Program Files\Common Files\Voltage Security\

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

TO:

C:\Windows\system32|C:\Windows|C:\Windows\System32\Wbem|C:\Windows\System32\WindowsPowerShell\v1.0|C:\Program Files (x86)\Microsoft Application Virtualization Client|C:\Program Files (x86)\QuickTime\QTSystem|

C:\Program Files (x86)\Enterprise Vault\EVClient|C:\Program Files (x86)\Voltage Security\Voltage SecureMail|C:\Program Files (x86)\Common Files\Voltage Security|C:\Program Files\Voltage Security\Voltage SecureMai

l|C:\Program Files\Common Files\Voltage Security\

PATHEXT=.COM|.EXE|.BAT|.CMD|.VBS|.VBE|.JS|.JSE|.WSF|.WSH|.MSC

Obvioiusly I am not wanting to change the actual Path, just in the action, pulling the values of PATH.

Any help would be appreciated.

(imported comment written by wnolan91)

Ok… i figured it out…

q:( concatenation “|” of substrings separated by “;” of (value “Path” of key “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” of registry as string as lowercase))

A: %25systemroot%25\system32|%25systemroot%25|%25systemroot%25\system32\wbem|%25systemroot%25\system32\windowspowershell\v1.0|c:\program files (x86)\microsoft application virtualization client|c:\program files (x86)\quicktime\qtsystem|c:\program files (x86)\enterprise vault\evclient|c:\program files (x86)\voltage security\voltage securemail|c:\program files (x86)\common files\voltage security|c:\program files\voltage security\voltage securemail|c:\program files\common files\voltage security%00

T: 0.680 ms

I: singular stringg