我在这里花了很长时间才得到一些正确的语法。
我有一个小的VB脚本,它提示输入凭据,然后使用这些凭据运行另一个vb脚本:
set objShell = WScript.CreateObject("WScript.Shell")
strAdminName = inputBox("What is your username (Domain\Username)")
objShell.Run "runas /user:" & strAdminName & " ""Wscript.exe \\xxx.xx.xxx\dfs\Tumw-IS\Juniper Tools and Utilities\Juniper Removal Tools\delete_folders.vbs"" "当我运行脚本时,一切正常,除了它找不到我调用的脚本。我收到一个错误,指出"There no file extension in "\xxx.xx.xxx\dfs\tumw- is \Juniper“
显然,问题在于文件位置有空格,而且我使用的是DFS链接。当我运行此命令并将目标位置设置为没有空格的VBS文件时,它工作得很好。
我就是找不到语法来处理DFS链接或名称中的空格。我认为它很简单,但我就是不能让它工作。
有什么想法吗?
谢谢
-John
发布于 2014-04-29 09:29:37
试试这个:
objShell.Run "runas /user:" & strAdminName & " ""Wscript.exe \""\\xxx.xx.xxx\dfs\Tumw-IS\Juniper Tools and Utilities\Juniper Removal Tools\delete_folders.vbs\"""""https://stackoverflow.com/questions/23353804
复制相似问题