Need help with runonce and starting service

(imported topic written by DotA)

This is what I’m trying to do:

  1. perform upgrade install

  2. delete reg keys that get created after upgrade and reboot

  3. net start a service

I’m OK with the install and using appendfile to create a .reg file and calling the regfile in the runonce line. But I’m unable to successfully import the net start command into the runonce directly. The net start has to take place after the reg key deletion.

scripts tried:

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

" “NetStart”=cmd /c “net start sharedaccess”

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

" “NetStart”=“cmd /c “net start sharedaccess””

Neither populate the runonce. Any advice?

(imported comment written by DotA)

Update: This one worked, just had the quotes in the wrong place

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

" “NetStart”=“cmd /c net start sharedaccess”