VBS帮助!

扫码查看
本文介绍了VBS帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个脚本,当我点击它时,它将:


1。打开Chrome


2。打开Connexus.com


3。问我是否需要它来登录我


4。输入我的用户名和密码


以下是我到目前为止的内容

设置WshShell = WScript.CreateObject(" WScript.Shell" ;)
fso = InputBox("验证您是系统管理员,请输入您的登录密码。")
if fso<> " Connexus"然后
lol = msgBox("你输入的密码不正确。",16,"错误")
wscript.Quit
如果
结束如果fso =" Connexus"然后

Dim oShell
设置oShell = CreateObject(" WSCript.shell")
oShell.run(" chrome.exe")

wscript.sleep 300
wshshell.sendkeys" c"
wscript.sleep 100
wshshell.sendkeys" o"
wscript.sleep 100
wshshell.sendkeys" n"
wscript.sleep 100
wshshell.sendkeys" n"
wscript.sleep 100
wshshell.sendkeys" e"
wscript.sleep 100
wshshell.sendkeys" x"
wscript.sleep 100
wshshell.sendkeys" u"
wscript.sleep 100
wshshell.sendkeys" s"
wscript.sleep 100
wshshell.sendkeys"。"
wscript.sleep 100
wshshell.sendkeys" c"
wscript.sleep 100
wshshell.sendkeys" o"
wscript.sleep 100
wshshell.sendkeys" m"
wscript.sleep 100
wshshell.sendkeys" "
wscript.sleep 100
wshshell.sendkeys" {BACKSPACE}"
wscript.sleep 100
wshshell.sendkeys" {ENTER}"
wscript.sleep 2000
MsgBox"你需要我为你登录吗?",4,"登录"
如果MsgBoxResult = vbYes然后
wshshell.sendkeys" u"
wscript.sleep 100
wshshell.sendkeys" s"
wscript.sleep 100
wshshell.sendkeys" e"
wscript.sleep 100
wshshell.sendkeys" r"
wscript.sleep 100
wshshell.sendkeys" n"
wscript.sleep 100
wshshell.sendkeys" a"
wscript.sleep 100
wshshell.sendkeys" m"
wscript.sleep 100
wshshell.sendkeys" e"
wscript.sleep 100
wshshell.sendkeys" 1"
wscript.sleep 100
wshshell.sendkeys" 2"
wscript.sleep 100
wshshell.sendkeys" 3"
wscript.sleep 100
wshshell.sendkeys" 4"
wscript.sleep 100
wshshell.sendkeys" 5"
wscript.sleep 100
wshshell.sendkeys" {TAB}"
wscript.sleep 300
wshshell.sendkeys" p"
wscript.sleep 100
wshshell.sendkeys" a"
wscript.sleep 100
wshshell.sendkeys" s"
wscript.sleep 100
wshshell.sendkeys" s"
wscript.sleep 100
wshshell.sendkeys" w"
wscript.sleep 100
wshshell.sendkeys" o"
wscript.sleep 100
wshshell.sendkeys" r"
wscript.sleep 100
wshshell.sendkeys" d"
wscript.sleep 100
wshshell.sendkeys" 1"
wscript.sleep 100
wshshell.sendkeys" 2"
wscript.sleep 100
wshshell.sendkeys" 3"
wscript.sleep 500
wshshell.sendkeys" {ENTER}"
wscript.sleep 100
其他
msgbox("你去!:)")
结束如果

这一直给我一个错误,请帮忙解决它:)谢谢

解决方案

I'm trying to make a script that when I click it, it will:

1. Open Chrome

2. Open Connexus.com

3. Ask If I need it to log me in

4. Enter my username and password

Here's what I got so far

Set WshShell = WScript.CreateObject("WScript.Shell")
fso = InputBox("To verify that you the system administrator, please enter your login password.")
if fso <> "Connexus" then
lol=msgBox("The password you entered was incorrect.",16,"Error")
wscript.Quit
end if
if fso = "Connexus" then

Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run ("chrome.exe")

wscript.sleep 300
wshshell.sendkeys "c"
wscript.sleep 100
wshshell.sendkeys "o"
wscript.sleep 100
wshshell.sendkeys "n"
wscript.sleep 100
wshshell.sendkeys "n"
wscript.sleep 100
wshshell.sendkeys "e"
wscript.sleep 100
wshshell.sendkeys "x"
wscript.sleep 100
wshshell.sendkeys "u"
wscript.sleep 100
wshshell.sendkeys "s"
wscript.sleep 100
wshshell.sendkeys "."
wscript.sleep 100
wshshell.sendkeys "c"
wscript.sleep 100
wshshell.sendkeys "o"
wscript.sleep 100
wshshell.sendkeys "m"
wscript.sleep 100
wshshell.sendkeys " "
wscript.sleep 100
wshshell.sendkeys "{BACKSPACE}"
wscript.sleep 100
wshshell.sendkeys "{ENTER}"
wscript.sleep 2000
MsgBox "Do you need me to log in for you?",4,"Log In"
    if MsgBoxResult = vbYes then
	wshshell.sendkeys "u"
	wscript.sleep 100
	wshshell.sendkeys "s"
	wscript.sleep 100
	wshshell.sendkeys "e"
	wscript.sleep 100
	wshshell.sendkeys "r"
	wscript.sleep 100
	wshshell.sendkeys "n"
	wscript.sleep 100
	wshshell.sendkeys "a"
	wscript.sleep 100
	wshshell.sendkeys "m"
	wscript.sleep 100
	wshshell.sendkeys "e"
	wscript.sleep 100
	wshshell.sendkeys "1"
	wscript.sleep 100
	wshshell.sendkeys "2"
	wscript.sleep 100
	wshshell.sendkeys "3"
	wscript.sleep 100
	wshshell.sendkeys "4"
	wscript.sleep 100
	wshshell.sendkeys "5"
	wscript.sleep 100
	wshshell.sendkeys "{TAB}"
	wscript.sleep 300
	wshshell.sendkeys "p"
	wscript.sleep 100
	wshshell.sendkeys "a"
	wscript.sleep 100
	wshshell.sendkeys "s"
	wscript.sleep 100
	wshshell.sendkeys "s"
	wscript.sleep 100
	wshshell.sendkeys "w"
	wscript.sleep 100
	wshshell.sendkeys "o"
	wscript.sleep 100
	wshshell.sendkeys "r"
	wscript.sleep 100
	wshshell.sendkeys "d"
	wscript.sleep 100
	wshshell.sendkeys "1"
	wscript.sleep 100
	wshshell.sendkeys "2"
	wscript.sleep 100
	wshshell.sendkeys "3"
	wscript.sleep 500
	wshshell.sendkeys "{ENTER}"
	wscript.sleep 100
Else
	msgbox("There you go! :)")
End if

This keeps on giving me an error, please help fix it :) Thanks

解决方案


这篇关于VBS帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 18:23
查看更多