Categories:
Administration (10)
Adware Spyware (7)
Apache (10)
Bluetooth (125)
DOS Commands (1)
Edge (28)
General (2)
Internet Explorer (217)
Media Center (12)
Media Player (11)
Mozilla Firefox (18)
PHP (15)
Programming (8)
Security (4)
Silverlight (15)
Tips (17)
Tools (218)
Tutorials (5)
Windows 10 (166)
Windows 7 (636)
Windows 8 (1091)
Windows Phone (33)
Windows Server 2008 (165)
Windows Server 2012 (84)
Windows Server 2016 (23)
Windows Vista (52)
Collections:
Other Resources:
Remove Quotation Marks from Parameters
How to Remove Quotation Marks from Parameters?
✍: FYIcenter.com
If a parameter is passed in a quotation format,
you can remove quotation marks by using the
replacement function in the variable expansion expression
in 3 steps:
1. Assign the parameter to a variable. For example,
set x=%1
2. Update the variable with quotation marks removed:
set x=%x:"=% rem A more generic syntax is: %variable:old=new%
3. Use the variable anywhere you need it:
echo (%x%)
Here is a demonstration batch file called Parameter-Cleaned:
@echo off echo (%0) echo (%1) (%2) (%3) (%4) (%5) echo (%*) set x=%1 set x=%x:"=% echo (%x%)
You can test the above batch file like this:
C:\fyicenter>Parameter-Cleaned.bat "\Program Files (x86)\Java" (Parameter-Cleaned.bat) ("\Program Files (x86)\Java") () () () () ("\Program Files (x86)\Java") (\Program Files (x86)\Java)
⇒ Multiple Quotations in a Single Parameter
⇐ Use Quotation to Protect Space in File Name
2021-11-12, 1322👍, 0💬
Popular Posts:
What is muweb.dll - DLL File - Microsoft Update Web Control? muweb.dll is the Microsoft Update Web C...
What is "Ulead Burning Helper" in my Windows 7 service list? And how is "Ulead Burning Helper" servi...
How to review Internet Explorer (IE) add-on or Browser Helper Object (BHO) tools on Windows XP with ...
How to download and install Alexa Toolbar for Internet Explorer (IE) 7 browser? Alexa Toolbar offers...
How to select the second keyboard layout during the Windows 10 setup process? After your Windows 10 ...