31#define DV_CMD _T("DV")
32#define DV_CMD_LENGTH COMMAND_LENGTH(DV_CMD)
33#define DV_CMD_SHORT_DESC DV_CMD _T(" command is used to delete value.\n")
69 goto CheckValueArgument;
81 else if (!pszValueFull)
83 pszValueFull = pszParameter;
87 rConsole.
Write(
_T(
"Bad parameter: "));
88 rConsole.
Write(pszParameter);
94 TCHAR *pszValueNamePattern;
107 goto CommandNAonRoot;
110 pszValueNamePattern = pchSep?(pchSep+1):(pszValueFull);
111 pszPath = pchSep?pszValueFull:
_T(
".");
118 pszValueNamePattern = (
TCHAR*)pszEmpty;
123 size_t s =
_tcslen(pszValueNamePattern);
124 if (
s && (pszValueNamePattern[0] ==
_T(
'\"'))&&(pszValueNamePattern[
s-1] ==
_T(
'\"')))
126 pszValueNamePattern[
s-1] = 0;
127 pszValueNamePattern++;
140 DWORD dwMaxValueNameLength;
141 LONG nError =
Key.GetMaxValueNameLength(dwMaxValueNameLength);
144 _stprintf(
Buffer,
_T(
"Cannot query info about %s key. Error is %u\n"),
Key.GetKeyName(),(
unsigned int)nError);
149 TCHAR *pszValueName =
new (std::nothrow)
TCHAR[dwMaxValueNameLength];
152 rConsole.
Write(
"Out of memory.");
156 Key.InitValueEnumeration(pszValueName,dwMaxValueNameLength,
NULL,0,
NULL);
162 nError =
Key.DeleteValue(pszValueName);
172 Key.InitValueEnumeration(pszValueName,dwMaxValueNameLength,
NULL,0,
NULL);
188 _T(
"Syntax: ")
DV_CMD _T(
" [<PATH>][<VALUE_NAME>] [/?]\n\n")
189 _T(
" <PATH> - Optional relative path of key which value will be delete.\n")
190 _T(
" <VALUE_NAME> - Name pattern of key's value. Default is key's default value.\n")
191 _T(
" /? - This help.\n\n");
void InvalidateCompletion()
BOOL PatternMatch(const TCHAR *pszPattern, const TCHAR *pszTry)
#define COMMAND_NA_ON_ROOT
#define DV_CMD_SHORT_DESC
void ResetArgumentIteration()
TCHAR * GetNextArgument()
BOOL Write(const TCHAR *p, DWORD dwChars=0)
BOOL GetKey(const TCHAR *pchRelativePath, REGSAM DesiredAccess, CRegistryKey &rKey)
const TCHAR * GetLastErrorDescription()
virtual const TCHAR * GetHelpShortDescriptionString()
virtual const TCHAR * GetHelpString()
CShellCommandDeleteValue(CRegistryTree &rTree)
virtual int Execute(CConsole &rConsole, CArgumentParser &rArguments)
virtual ~CShellCommandDeleteValue()
virtual BOOL Match(const TCHAR *pchCommand)