我在pdf中创建了一个超链接,这个超链接绑定到vbs脚本,直到这一步都行。当我手动运行该脚本(双击)时,脚本会自动运行(打开telnet连接)。问题是当我通过超链接运行脚本时,CMD显示消息“”telnet“未被识别为内部或外部命令”。请,谁能告诉我为什么会发生?从超链接打开VBS

这是脚本:设置不正确

Dim WshShell, regexp

set regular = New RegExp

direccion = inputbox("Ingresa ip del equipo:")

' Set pattern.

regular.Pattern = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"

' Set case insensitivity.

regular.IgnoreCase = True

' Set global applicability.

regular.Global = True

if regular.test(direccion) = TRUE then

set WshShell=CreateObject("WScript.Shell")

WshShell.run "cmd.exe"

WScript.Sleep 1000

'Send commands to the window as needed - IP and commands need to be customized

'Step 1 - Telnet to remote IP'

WshShell.SendKeys "telnet " & direccion

WshShell.SendKeys ("{Enter}")

WScript.Sleep 1000

else

msgbox "Ingresa una ip válida"

end if

2016-08-18

Frnndo

+0

当我手动运行脚本(双击)时,在任务管理器中出现“Windows命令处理器”,但当我通过任务管理器中的超链接(pdf文件)运行脚本时,出现了一些奇怪的事情“Windows命令处理器(32位)“,我认为这个问题可能与此有关,但我不知道如何解决它。任何想法?? –

更多推荐