Collections:
Other Resources:
String Variable Match and Replace
How to perform sub-string match and replacement in a string batch variable?
✍: FYIcenter.com
You can perform a sub-string match and replacement in a string batch variable using the following variable modifier:
%variable:pattern=str%
Wildcard character "*" can be used in "pattern" to match any number of any characters.
Examples of string match and replacement modifiers:
rem Remove all double quotes from a string set variable=%variable:"=% rem Replace all "bar" to "foo" set variable=%variable:bar=foo% rem Remove the drive letter from a path name set java_home=%java_home:*:\=\%
⇒ Get Sub-String from Variable
⇐ What Are Batch Built-in Variables
2021-10-10, 1494🔥, 0💬
Popular Posts:
How to use sc.exe command to delete an existing service? If you want to delete a service created by ...
Where to find tutorials on Internet Explorer (IE) 7. Here is a list of tutorials to answer many freq...
What is "UPnP Device Host" in my Windows 7 service list? And how is "UPnP Device Host" service relat...
How to remove BTTray.exe from startup program list? If you are not using any bluetooth devices, you ...
Can I remove startup application "DSentry.exe - Dell DVDSentry" to speedup my computer and reduce se...