We help IT Professionals succeed at work.

how to set registry for "run once"

I need to set a bat file in "HKLM\Software\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce " Need to know the steps how to add values in the this registry entries
Please do not through the links to follow becasue I had them already and they all very confusing and thats why Iam here so I can get some steps to follow
Thanks
Comment
Watch Question

Commented:
In the RunOnce folder, create a string value names whatever you, with the data being the command you want to run. If spaces are involved use " "

Does that help?

Author

Commented:
need more details
REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]

REG ADD "HKLM\Software\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v MyBatFile /t REG_SZ /d "C:\MyFolder\MyBatFile.BAT"
Above command should be run in command prompt..

Author

Commented:
It dodn't work but I was able to set manually and it did work. Now I am trying to export this registry to other machines using unattended bat file but this bat file gives me a worning "Are you sure you want to add infor....."
with the option "Yes" and "No" any ideas how I can automate this??

Thanks
Commented:
use the /f switch for "Force"

Reg Add /?
...
"/f       Force overwriting the existing registry entry without prompt"
DonNetwork Administrator

Commented:
Why dont you use group policy for this ?


http://zienkiewicz.eu/?p=63


also explained in method 2 here



http://www.winhelponline.com/blog/disable-ie8-tour-welcome-screen-runonce-all-users/

Author

Commented:
This works Thanks