0
我正在使用批處理文件更新註冊表&想要打開註冊表HKLM \ SYSTEM \ CurrentControlSet \ services \ RasMan \ PPP \ EAP \ 13確認reg更新成功。 reg更新執行,但我無法讓註冊表打開在特定路徑。 註冊表路徑可以在更新之前或之後打開。編輯註冊表項並用批處理文件打開註冊表
REM --add以下到你的蝙蝠頂部file--
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else (goto gotAdmin)
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
echo off
start regedit
reg add HKLM\SYSTEM\CurrentControlSet\services\RasMan\PPP\EAP\13 /v TlsVersion /t REG_DWORD /d 0x000000c0
start regedit
HKLM\SYSTEM\CurrentControlSet\services\RasMan\PPP\EAP\13
end
感謝您的意見。這似乎是一個可用workarround REG EXPORT HKLM \系統\ CurrentControlSet \服務\ RasMan驗證\ PPP \ EAP \ 13 \ TlsVersion/Y的test.txt TYPE的test.txt 開始test.txt的 –
方法在這裏也 - http://stackoverflow.com/questions/445167/how-can-i-get-the-value-of-a-registry-key-from-within-a-batch-script @David_D –