我需要在脚本中将路径返回到当前用户桌面。现在我知道你可以用WScript来做。使用shell.application创建特殊文件夹
var WshShell = WScript.CreateObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
但对于我的脚本,这将不起作用,因为我不能使用WScript。但是我可以像下面那样使用shell.application对象。
dim objShell
dim ssfWINDOWS
dim objFolder
ssfWINDOWS = 0
set objShell = CreateObject("shell.application")
set objFolder = objshell.BrowseForFolder(0, "Example", 0, ssfWINDOWS)
if (not objFolder is nothing) then
Set objFolderItem = objFolder.Self
g_objIE.Document.All("logdir").Value = objFolderItem.path
end if
set objFolder = nothing
set objShell = nothing
什么是语法,而不是“BrowseForFolder”我可以简单地返回当前用户桌面的路径?
IE替换的equilivent线
set objFolder = objshell.BrowseForFolder(0, "Example", 0, ssfWINDOWS)
。
strDesktop = WshShell.SpecialFolders("Desktop");
干杯
亚伦
欢呼,这是完美的,你可能是正确的关于第二点。欢呼的链接非常有用。 – DevilWAH