使用VBScript中的剪贴板 [英] Use clipboard from VBScript

查看:72
本文介绍了使用VBScript中的剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种使用 VBScript 在剪贴板上放置一些文本的方法。有问题的VBScript将作为我们的登录脚本的一部分进行部署。我想避免使用在干净的Windows XP系统上不可用的任何东西。

I am looking for a method to place some text onto the clipboard with VBScript. The VBScript in question will be deployed as part of our login script. I would like to avoid using anything that isn't available on a clean Windows XP system.

编辑:

我们想鼓励组织内部的用户使用文件服务器来传输文档,而不是通过电子邮件不断发送附件。最大的障碍之一是人们并不总是清楚文件/文件夹的正确网络路径。我们开发了一个快速脚本,并将其附加到Windows上下文菜单中,以便用户可以右键单击任何文件/文件夹,并获取可以将其通过电子邮件发送给我们组织内某人的URL。

We wanted to encourage users inside our organization to use the file server to transfer documents instead of constantly sending attachments by email. One of the biggest barriers to this is that it isn't always obvious to people what the correct network path is to a file/folder. We developed a quick script, and attached it to the Windows context menu so that a user can right click on any file/folder, and get a URL that they can email to someone within our organization.

我希望将对话框中显示的URL也放置在剪贴板上。

I want the URL displayed in the dialog box to also be placed onto the clipboard.

GetNetworkPath

推荐答案

Microsoft并未提供VBScript的解决方案直接访问剪贴板。如果您在'剪贴板' -us / dninvbs / html / keydifferencesweenvisualbasicforapplicationsvbscript.asp rel = noreferrer>此网站,您将看到:

Microsoft doesn't give a way for VBScript to directly access the clipboard. If you do a search for 'clipboard'on this site you'll see:


尽管Visual Basic for Applications支持屏幕,打印机,应用程序,调试,Err和剪贴板对象,但是VBScript仅支持Err对象。因此,VBScript不允许您访问诸如鼠标指针或剪贴板之类的有用对象。但是,您可以使用Err对象为应用程序提供运行时错误处理。

Although Visual Basic for Applications supports the Screen, Printer, App, Debug, Err, and Clipboard objects, VBScript supports only the Err object. Therefore, VBScript does not allow you to access such useful objects as the mouse pointer or the clipboard. You can, however, use the Err object to provide runtime error handling for your applications.

因此,间接使用记事本可能是最好的选择您只需使用VBScript即可。

So using notepad indirectly is probably about the best you'll be able to do with just VBScript.

这篇关于使用VBScript中的剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆