加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

vbscript – 如何在64位Windows中检索启动文件夹位置

发布时间:2020-12-14 04:27:51 所属栏目:Windows 来源:网络整理
导读:我有一个VB脚本,它添加了 Windows Startup文件夹的程序快捷方式.在我的脚本中,我能够使用以下方法检索32位Windows中的Startup文件夹位置: Set objShell = CreateObject("WScript.Shell") startupFolder = objShell.SpecialFolders("Startup") 但是当我在64
我有一个VB脚本,它添加了 Windows Startup文件夹的程序快捷方式.在我的脚本中,我能够使用以下方法检索32位Windows中的Startup文件夹位置:

Set objShell = CreateObject("WScript.Shell")
  startupFolder = objShell.SpecialFolders("Startup")

但是当我在64位Windows上尝试时,它什么都不返回.具体来说,我正在测试64位Vista.我似乎无法找到适当的环境变量或语法.谢谢.

解决方法

尝试使用 Shell.Application对象的替代变体:

Const ssfSTARTUP = &H7

Set oShell = CreateObject("Shell.Application")
Set startupFolder = oShell.NameSpace(ssfSTARTUP)

If Not startupFolder Is Nothing Then
  WScript.Echo startupFolder.Self.Path
End If

对你起作用吗?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读