Unable to add/modify registry value

(imported topic written by shiva91)

Hi

I have a task to change or add the registry value for that i have used the following two scripts, both are executing with out any error but the registry modification is not happening.

I have tried in windows xp and windows 2000 nodes. Kindly check and if any modification in the script.

Script1:

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

" “AutoRun”=“cd /d C:”

Script2: (from Windows Registry Wizard)


action uses wow64 redirection false

delete __createfile

delete wizardedit.reg

createfile until @end_create_reg_file

Windows Registry Editor Version 5.00

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

“AutoRun”=“cd /d C:”

@end_create_reg_file

move __createfile wizardedit.reg

waithidden regedit /s “wizardedit.reg”


Regards,

Shiva

(imported comment written by NoahSalzman)

Copied from the

Action Script User Guide

:

One of the rules of the .reg file is that any \’s in the value field need to appear as double slashes, that is \. So if you were trying to assign the value SourcePath2 of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion to c:\I386, the command that you would define would look like this:

regset 
"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]" 
"SourcePath2"=
"c:\\I386"

regset 
"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]" 
"SourcePath2"=
{escape of 
"c:\I386"
}

The last example uses the escape relevance clause to automatically convert backslashes to double backslashes.

(imported comment written by shiva91)

Hello Noah,

Thanks for reply,

Here the key itself is not creating/modifying in the registry of the deployed machine.

Regards,

Shiva

(imported comment written by NoahSalzman)

Have you tried changing “cd /d C:” to “cd /d C:\” ?

(imported comment written by shiva91)

Even after changing “cd /d C:” to “cd /d C:\”, its not working and key itself is not creating/modifying.

Regards,

Shiva