列出本地打开文件的脚本 [英] Script to list locally opened files

查看:74
本文介绍了列出本地打开文件的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在寻找一个脚本,最好是vbs,它可以列出在系统上本地打开的文件.
我可以使用net file命令列出通过共享访问打开的文件,但是我希望看到在系统上本地打开的文件.
我尝试过openfiles.exe,打开了/local并重新启动,但是没有运气,我在本地打开了一个文件,尝试了.txt和xls文件,但没有列出任何内容.
如果您能指出脚本示例,将不胜感激.我也熟悉wmi编程等.

谢谢.

Hello,
I am looking for a script, preferably vbs, that can list files opened locally on a system.
I can use the net file command to list files opened through share access, but I am looking to see files opened locally on the system.
I have tried openfiles.exe, turned local on with /local on and rebooted but no luck, I open a file locally, tried .txt and xls files and it lists nothing.
If you could point me to a script sample, it would be appreciated. I am familiar with wmi programming and the like as well.

Thank you.

推荐答案

是否可以访问我的最近文档"帮助?
该脚本应满足以下条件:

常量MY_RECENT_DOCUMENTS =&H8&

设置objShell = CreateObject("Shell.Application")
设置objFolder = objShell.Namespace(MY_RECENT_DOCUMENTS)
设置objFolderItem = objFolder.Self
Wscript.Echo objFolderItem.Path

设置colItems = objFolder.Items
对于colItems中的每个objItem
Wscript.Echo objItem.Name
下一个
Would accessing ''My Recent Documents'' help?
This script is supposed to that:

Const MY_RECENT_DOCUMENTS = &H8&

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_RECENT_DOCUMENTS)
Set objFolderItem = objFolder.Self
Wscript.Echo objFolderItem.Path

Set colItems = objFolder.Items
For Each objItem in colItems
Wscript.Echo objItem.Name
Next


这篇关于列出本地打开文件的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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