Remove Quotation Marks from Parameters
How to Remove Quotation Marks from Parameters?
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,
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:
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)
2017-12-05, 250👍, 0💬
How do I remove the list of files that I have recently played from the File menu in the Player? In o...
I just installed the Windows 8 Release Preview on the Samsung slate that we attendees got at the MIX...
What is a slide master? A slide master is a set of slide layouts defined to help you create differen...
What is the startup program "CyberLink MediaLibray Service - CLMLSvc_P2G8.exe" on my Windows 8 compu...
How to use sc.exe command to create a new service? If you want to create a new service, you can use ...