1

Can anyone help me to how to run command ipconfig /registerdns using VBScript. I have tried with below code:

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "%COMSPEC% /k ipconfig /registerdns"

When I am running the script I am getting

The requested operation requires elevation.

The above sample code is one piece of the script. There is some other code also which are not required to run as admin. This particular piece of code requires to run as admin. PS: I don't have to run whole script as admin just part of the script needs to run as administrator. And this is independent one and it has to run directly on command prompt not calling from any other script.

manohar e
  • 327
  • 3
  • 6
  • 16

0 Answers0