Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
80004005工作的VBScript出现错误_Vbscript - Fatal编程技术网

80004005工作的VBScript出现错误

80004005工作的VBScript出现错误,vbscript,Vbscript,由于某些原因,我有一个网络驱动器,在通过快捷方式访问之前无法连接。因此,我在启动脚本中添加了一个run命令,用于启动我的电子邮件和IM应用程序。脚本运行正常,但我不断收到错误80004005 Dim WshShell, objShell, oShell Set objShell = WScript.CreateObject("WScript.Shell") Set WshShell = CreateObject("WScript.Shell") 'Check for network conn

由于某些原因,我有一个网络驱动器,在通过快捷方式访问之前无法连接。因此,我在启动脚本中添加了一个run命令,用于启动我的电子邮件和IM应用程序。脚本运行正常,但我不断收到错误80004005

Dim WshShell, objShell, oShell

Set objShell = WScript.CreateObject("WScript.Shell")
Set WshShell = CreateObject("WScript.Shell")

'Check for network connection
strURL = "server1"

set png = WshShell.exec("ping -n 1 " & strURL)
do until png.status = 1
    WScript.Sleep 5000
loop
strPing = lcase(png.stdout.readall)
Select Case True
     Case InStr(strPing, "reply from") > 1 

'Launch Chrome
objShell.Run("""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe""")

'Launch Pidgin
objShell.Run("""C:\Program Files (x86)\Pidgin\pidgin.exe""")

'Initiate Y:\
    objShell.Run("C:\Users\kwag.myers\Documents\Y.lnk") 'this line errors
    Wscript.Sleep 500

Set oShell = CreateObject("WScript.Shell")
    oShell.AppActivate "Y:\"
    Wscript.Sleep 500
    WshShell.SendKeys "%{F4}"

Case Else
End Select 
Set WshShell = Nothing
Set objShell = Nothing
WScript.Quit

在哪一行出现错误?脚本运行在什么用户上下文中?我想这可能是权限问题。eurotrash,第23行:objShell.RunC:\Users\kwag.myers\Documents\Y.lnk'这一行有错误。Comintem,我不确定你的确切意思。我有管理员权限,但没有以admin.Comintem的身份登录,我查看了一些文件夹权限,发现Y:/有一些特殊设置。当我进入目录时,没有列出这些特殊权限。因此,我将Y.lnk属性设置得更深一些,并匹配了关闭的AppActivate目录,没有更多错误。谢谢