0
我想自動打開Gmail並使用憑證登錄到它。在瀏覽器中打開Gmail並自動登錄
對於這一點,我已經寫了其中包含下面的代碼名爲.ps1腳本:
set WshShell = WScript.CreateObject("WScript.Shell")
call WshShell.Run("https://www.gmail.com", 1, false)
WScript.Sleep 2000
WshShell.SendKeys "prudhvi"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "prudhvi9"
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Quit()
這引發以下錯誤:
At C:\Users\admin\Desktop\sample.ps1:2 char:46
+ call WshShell.Run("https://www.gmail.com", 1, false)
+ ~
Missing expression after ','.
At C:\Users\admin\Desktop\sample.ps1:2 char:47
+ call WshShell.Run("https://www.gmail.com", 1, false)
+ ~~~~~
Unexpected token 'false' in expression or statement.
At C:\Users\admin\Desktop\sample.ps1:2 char:46
+ call WshShell.Run("https://www.gmail.com", 1, false)
+ ~
Missing closing ')' in expression.
At C:\Users\admin\Desktop\sample.ps1:2 char:52
+ call WshShell.Run("https://www.gmail.com", 1, false)
+ ~
Unexpected token ')' in expression or statement.
At C:\Users\admin\Desktop\sample.ps1:13 char:14
+ WScript.Quit()
+ ~
An expression was expected after '('.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : MissingExpressionAfterToken
什麼可能的錯誤是什麼?
謝謝。這工作 – prudhvi
prudhvi9是不是你的密碼,我希望;-) – SBF