Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 通过网络运行WMIC文件版本?_Batch File - Fatal编程技术网

Batch file 通过网络运行WMIC文件版本?

Batch file 通过网络运行WMIC文件版本?,batch-file,Batch File,我正在尝试通过网络运行WMIC以获取特定文件的版本。我知道要获取本地文件版本,您可以执行以下操作: wmic datafile where name='\\C:\localfile.exe' get version 如果我想在网络上找到它怎么办?像这样: wmic datafile where name='\\fileserver\\e$\\file.exe' get version 有可能这样做吗?我有问题服务器的用户名和密码 wmic /NODE fileserver /USER use

我正在尝试通过网络运行WMIC以获取特定文件的版本。我知道要获取本地文件版本,您可以执行以下操作:

wmic datafile where name='\\C:\localfile.exe' get version
如果我想在网络上找到它怎么办?像这样:

wmic datafile where name='\\fileserver\\e$\\file.exe' get version
有可能这样做吗?我有问题服务器的用户名和密码

wmic /NODE fileserver /USER user /PASSWORD pass datafile where name='e:\\file.exe' get version
是的,您需要指明用户和密码,除非执行查询的用户拥有远程节点的权限

查询是针对本地(到远程计算机)数据库执行的,该数据库的元素已注册到本地(到远程)路径

而反斜杠需要避免