先开一个试试看- #@&cls&powershell "type %~s0|out-string|iex"&pause&exit
- $ie=new-object -com internetexplorer.application
- $ie.Visible=1
- $ie.Navigate('192.168.9.211')
- sleep 3
- $doc=$ie.document
- function getElementById($doc,$id){[System.__ComObject].InvokeMember('getElementById', [System.Reflection.BindingFlags]::InvokeMethod, $null, $doc, $id)}
- (getElementById $doc 'username').value='admin1'
- (getElementById $doc 'password').value='@admin1'
- [System.__ComObject].InvokeMember('getElementsByClassName', [System.Reflection.BindingFlags]::InvokeMethod, $null, $doc, 'btn btn-primary login-btn').click()
复制代码
|