Dim objShell,strCommonLine,strCommond1,strCommond2
Set objShell = CreateObject(WScript.Shell)
strCommonLine = "powershell.exe"
app = objShell.Run(strCommonLine)
objShell.AppActivate app

WScript.Sleep 100 
'对应角色功能列表命令
strCommond1 = "Import-Module ServerManager{ENTER}Add-WindowsFeature Application-Server,As-Web-Support,As-Ent-Services{ENTER}"
objShell.SendKeys strCommond1


WScript.Sleep 100
'退出操作
strCommond2 = "exit{ENTER}"
objShell.SendKeys strCommond2
WScript.quit

 

相关文章:

  • 2021-12-27
  • 2021-12-09
  • 2022-01-17
  • 2021-08-26
  • 2021-10-09
  • 2021-08-15
  • 2021-08-13
  • 2022-01-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-07-25
  • 2021-08-31
  • 2021-12-07
  • 2022-03-09
相关资源
相似解决方案