Craig Paulsen
asked on
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
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
ASKER
thanks for your reply oBdA
the key I'm wanting to add = reg add HKEY_LOCAL_MACHINE\SYSTEM\ CurrentCon trolSet\Se rvices\Csc \Parameter s /v FormatDatabase /t REG_DWORD /d 1 /f
this basically reset the offline cache on reboot of laptop.
the key I'm wanting to add = reg add HKEY_LOCAL_MACHINE\SYSTEM\
this basically reset the offline cache on reboot of laptop.
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
ASKER
Thanks, will try this in the morning
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks, this worked beautifully!
ASKER
this worked a charm, thank you!
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.