gpt4 book ai didi

VBScript 无效字符 800A0408 编译错误

转载 作者:行者123 更新时间:2023-12-02 10:48:08 31 4
gpt4 key购买 nike

当我尝试在 Windows 7 中的命令提示符下运行以下 vbs 代码时,出现编译错误。

Option Explicit
Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3
Dim strDriveLetter1, strDriveLetter2, strDriveLetter3, strUserName

Set objNetwork = CreateObject("WScript.Network")
strUserName = objNetwork.UserName

strDriveLetter1 = "H:"
strDriveLetter2 = "P:"
strDriveLetter3 = "S:"
strRemotePath1 = "\\test\public\users\" & strUserName & "\"
strRemotePath2 = "\\test\public\groups\"
strRemotePath3 = "\\test\scans\"


'Section which maps two drives, M: and P: and S:
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3

'Extra code just to add a message box
WScript.Echo "Map drives " & strDriveLetter1 & " & " & strDriveLetter2 & " & " & strDriveLetter3

Wscript.Quit

它说问题出在第 1 行字符 1。有什么想法吗?

最佳答案

一个可能的问题是你的文件是如何编码的;尝试将其另存为 ANSI 并再次运行。

关于VBScript 无效字符 800A0408 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2039104/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com