0
votes

I have a problem when I tried to update via batch file registry key as follows:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultPassword /t REG_SZ /d "vovaogova!"

but the exclamation mark is missing when I check it!! I know that there is meaning of exclamation mark in the path but what about the value?

2
Have you got delayed expansion enabled while executing your command line? - aschipfl
yes. should I remove this line? - Hezi Israeli
Delayed expansion consumes exclamation marks, so yes, remove it… - aschipfl

2 Answers

0
votes

Maybe try using an escape character: ^

Like that: REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultPassword /t REG_SZ /d "vovaogova^!"

For me, it adds the caret, but, try that.

-1
votes

As as aschipfl said.

I removed SETLOCAL EnableDelayedExpansion from my script and it works!!