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