|
| |
$DEQUOT (Remove Outer Quotes)
Description
Removes ONLY outer quotes from a variable's contents -OR- a "Quoted String".
Similar to the builtin de-quoting in Windows 2000 and above,
but $DEQUOT performs CONSISTENTLY under NT/2K/XP/K3.
Syntax
At the Command Prompt (library
IS NOT initialized)
|
C:\>NTCmdLib |
$DEQUOT VariableName|"Quoted String" |
At the Command Prompt (library
IS initialized)
|
C:\>L |
$DEQUOT VariableName|"Quoted String" |
In a Script (library IS NOT
initialized)
|
CALL
NTCmdLib |
$DEQUOT VariableName|"Quoted String" |
In a Script (library IS
initialized)
|
%.Call% |
$DEQUOT VariableName|"Quoted String" |
Parameters and Switches
| VariableName |
|
Name of a variable containing the String to be processed. |
| "Quoted String" |
|
A literal "Quoted String" to be DE-quoted. |
Errorlevels, Output Variables and Custom Mount/\Commands
|
Name |
|
Value |
|
Description/Contents |
|
_DEQUOT |
|
string |
|
variable containing the DE-quoted text
as specified on the command line. |
|
ErrorLevel |
|
Description/Contents |
|
0 |
|
Success |
|
2 |
|
Missing or invalid parameter
String not quoted |
Examples, Notes and Instructions
Example 1 - Remove outer quotes from the contents of a variable
|
NTCmdLib $DEQUOT
VariableName |
Output is in %VariableName%
Example 2 - Remove outer quotes from a literal string
|
NTCmdLib $DEQUOT
"Quoted String" |
Output is in %_DEQUOT%
Notes
- DO NOT enclose VariableName in a "second set" of quotes when calling $DEQUOT.
|
NTCmdLib $DEQUOT
"VariableName" |
will effectively do nothing. VariableName will be treated as a literal string and %_DEQUOT% will contain the
literal text "VariableName".
- Output is displayed to STDOUT, errors to STDERR
- To suppress console display, use the library GlobalSwitch /Quiet (or simply /q)
NTCmdLib /Q TaskID /TaskSwitches Parameters
CALL NTCmdLib /Q TaskID
/TaskSwitches Parameters
%.Call% /Q TaskID /TaskSwitches Parameters
Related .Mount/\Commands, #Constants,
$Functions, :Procedures
|
Resource |
|
Short Description |
| |
|
|
|
K
E
Y |
Common Commands |
INTERNAL |
External |
/SWITCH |
Parameter |
Help text |
AddonTool |
|
Mounted Commands |
.Mount/\Command |
CmdShorthand |
#Constant |
$FUNCTION |
:Procedure |
!GuardNote |
|
Operating Systems |
NT/2K/XP/K3 |
NT Only |
NT/2K |
2K Only |
2K/XP |
XP Only |
XP/K3 |
K3 Only |
2K/XP/K3 |
|