vbs中获取脚本当前路径的3个方法
方法一:
方法二:
方法三:
msgbox "当前文件路径是 " & wscript.ScriptFullName set ws=CreateObject("WScript.Shell") MsgBox "当前文件夹是 " & ws.CurrentDirectory
出处:http://www.hechaku.com/arcitle/20187224.html
https://www.cnblogs.com/dreamer-fish/p/14004033.html
=======================================================================================
WScript Object
Provides access to root object for the Windows Script Host object model.
Remarks
The WScript object is the root object of the Windows Script Host object model hierarchy. It never needs to be instantiated before invoking its properties and methods, and it is always available from any script file. The WScript object provides access to information such as:
-
command-line arguments,
-
the name of the script file,
-
the host file name,
-
and host version information.
The WScript object allows you to:
-
create objects,
-
connect to objects,
-
disconnect from objects,
-
sync events,
-
stop a script's execution programmatically,
-
output information to the default output device (either a Windows dialog box or the command console).
The WScript object can be used to set the mode in which the script runs (either interactive or batch).
Legacy Code Example
Since the WScript object is the root object for the Windows Script Host object model, many properties and methods apply to the object. For examples of specific syntax, visit the properties and methods links.
Properties
Arguments Property | BuildVersion Property | FullName Property (WScript Object) | Interactive Property | Name Property | Path Property | ScriptFullName Property | ScriptName Property | StdErr Property | StdIn Property | StdOut Property | Version Property
Methods
ConnectObject Method | CreateObject Method | DisconnectObject Method | Echo Method | GetObject Method | Quit Method | Sleep Method
See Also
WshShell Object
WshNetwork Object
出处:https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/windows-scripting/at5ydy31(v=vs.84)
关注我】。(●'◡'●)
如果,您希望更容易地发现我的新博客,不妨点击一下绿色通道的【因为,我的写作热情也离不开您的肯定与支持,感谢您的阅读,我是【Jack_孟】!
本文来自博客园,作者:jack_Meng,转载请注明原文链接:https://www.cnblogs.com/mq0036/p/15934439.html
【免责声明】本文来自源于网络,如涉及版权或侵权问题,请及时联系我们,我们将第一时间删除或更改!
posted on 2022-02-25 08:58 jack_Meng 阅读(3268) 评论(0) 编辑 收藏 举报
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
2021-02-25 多种方式C#实现生成(条码/二维码)
2021-02-25 二维码(QR code)基本知识
2019-02-25 C# 自动升级
2019-02-25 C#更新程序设计
2019-02-25 学习SQLite数据库及命令
2019-02-25 C#实现自动升级(附源码)
2019-02-25 在WinForm中使用Web Services 来实现 软件自动升级( Auto Update ) (C#)