Add reg key remotely to laptop

Hi,
I would like to create a batch file that prompts you for a computer name, when help desk enters the specified computer name, the batch file then adds reg key to the specified machine,
Can u please guide me as to how to set this up
Craig PaulsenSenior Systems EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
Basically, it comes down to something like this:
set /p Computer=Please enter the name of the remote computer:
reg.exe add "\\%Computer%\HKLM\Software\Acme" /v "SomeValue" /t REG_SZ /d "Some String Data" /f

Open in new window

But you need to provide more details, especially whether the key (the "folder" in regedit) is under HKLM or HKCU (HKCU is more complicated), and which values exactly you need to add/set.
0
Craig PaulsenSenior Systems EngineerAuthor Commented:
thanks for your reply oBdA
the key I'm wanting to add = reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Csc\Parameters /v FormatDatabase /t REG_DWORD /d 1 /f

this basically reset the offline cache on reboot of laptop.
0
oBdACommented:
Then this should do the trick:
@echo off
setlocal
set Computer=
set /p Computer=Please enter the name of the computer on which to reset the offline cache:
if "%Computer%"=="" goto :eof
reg.exe add "\\%Computer%\SYSTEM\CurrentControlSet\Services\Csc\Parameters" /v FormatDatabase /t REG_DWORD /d 1 /f

Open in new window

0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Craig PaulsenSenior Systems EngineerAuthor Commented:
Thanks, will try this in the morning
0
oBdACommented:
Sorry, just noticed that the "HKLM" in the registry key got lost:
@echo off
setlocal
set Computer=
set /p Computer=Please enter the name of the computer on which to reset the offline cache:
if "%Computer%"=="" goto :eof
reg.exe add "\\%Computer%\HKLM\SYSTEM\CurrentControlSet\Services\Csc\Parameters" /v FormatDatabase /t REG_DWORD /d 1 /f

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Craig PaulsenSenior Systems EngineerAuthor Commented:
thanks, this worked beautifully!
0
Craig PaulsenSenior Systems EngineerAuthor Commented:
this worked a charm, thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.