I want to make changes to a registry key through this command:
REG ADD "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQLServer\SuperSocketNetLib\Tcp\IPAll" /v TcpDynamicPorts /t REG_SZ /d 6363 /f
This has to happen in a cmd, which i ran as administrator through powershell with this command in a batch file:
powershell.exe Start-Process cmd.exe -Verb runAs
I need a UAC Prompt for the user to input his admin credentials to make it as user friendly as possible. Now my question: How do i pass the reg add command to the console which i started as administrator?
Get-Credential.I could just start the powershell as admin, but then i wouldn't know how to pass the regedit command to the powershell either- Just use powershell to perform the task thatregis doing. Either usereglike you would from cmd or use powershell commands to do it