REM 以管理员权限运行
Set WshShell = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.Length = 0 Then
Set ObjShell = CreateObject("Shell.Application")
ObjShell.ShellExecute "wscript.exe" _
, """" & WScript.ScriptFullName & """ RunAsAdministrator", , "runas", 1
WScript.Quit
End if
REM 调用Browse选择文件夹
Const WINDOW_HANDLE = 0
Const NO_OPTIONS = 0
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder _
(WINDOW_HANDLE, "Select a folder:", NO_OPTIONS)
If objFolder Is Nothing Then
MsgBox "选择不能为空??"
WScript.Quit
End if
If objFolder & "" = "" Then
MsgBox "选择不能为空"
WScript.Quit
End if
dirPath = objFolder.Self.Path
REM 开始调用输入框
dim str
str = InputBox("请输入快捷方式名称")
If str & ""="" Then
MsgBox "名称不能为空"
WScript.Quit
End if
REM 创建文件夹快捷方式
set oShellLink = WshShell.CreateShortcut("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\快捷文件夹\" & str & ".lnk")
REM oShellLink.IconLocation = "" :
oShellLink.TargetPath = dirPath :
REM oShellLink.WorkingDirectory = "" :
REM oShellLink.Hotkey = "" :
oShellLink.WindowStyle = 1 :
REM oShellLink.Description = "系统默认计算器" :
oShellLink.Save :
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?