You're looking for the actual batch file command to create the registry value, aren't you? The REG ADD command would work from a "DOS" batch file. Open a new Command window and type REG ADD /? to see the syntax.
In this case you are adding a new String Value using these parameters:
REG ADD KeyPath /v NewName /t ValueType /d ValueData
reg add HKLM\SOFTWARE\Microsoft\Wi
Test to ensure it wrote value properly:
reg query HKLM\SOFTWARE\Microsoft\Wi
Here's the above in action from a CMD window:
C:\>reg add HKLM\SOFTWARE\Microsoft\Wi
REG_SZ /d "cmd.exe /c rd /s /q c:\temp\test"
The operation completed successfully
C:\>reg query HKLM\SOFTWARE\Microsoft\Wi
! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\SOFTWAR
DelDir REG_SZ cmd.exe /c rd /s /q c:\temp\test
and as an exported *.reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWA
"DelDir"="cmd.exe /c rd /s /q c:\\temp\\test"
Main Topics
Browse All Topics





by: deroodePosted on 2009-09-01 at 23:42:08ID: 25238428
Since rmdir (or rd) is a shell command you will have to start cmd.exe first. Remember that the RunOnce commands run as the logged in user, so there can be limited permissions.
Select allOpen in new window