Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does vbs implement the script in which the drive letter is double-clicked?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you the "vbs how to achieve the interpretation of the drive letter is double-clicked script", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn "vbs how to interpret the drive letter is double-clicked script" this article.

The copy code is as follows:

Do while true

Set WshShell = WScript.CreateObject ("WScript.Shell")

IF WshShell.AppActivate ("D:\") Then

MsgBox "ok"

Wscript.quit

End If

Loop

You don't even have to try to know that this code is wrong. Because WshShell.AppActivate considers the characters or strings contained in the Caption of the form, you use WshShell.AppActivate ("D:\"), which means that the string "D:\" should be included in the form Caption. But you open the D disk to have a look, is that so? They are all "local disks (D:)". If there is a volume label, it is even more uncertain. So it should be written as WshShell.AppActivate ("(D:)"). Considering the memory savings, it should be written like this:

Set WshShell = WScript.CreateObject ("WScript.Shell")

Do

IF WshShell.AppActivate ((D:)) Then

MsgBox "ok"

Wscript.quit

End If

Loop

The above is all the contents of the article "how to read the script in which the drive letter is double-clicked by vbs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report