如何使用WMI将文件复制到远程计算机(系统是Server 2003) [英] How to copy a file to remote machine(system is server 2003) using WMI

查看:319
本文介绍了如何使用WMI将文件复制到远程计算机(系统是Server 2003)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我想将文件复制到使用WMI的Win Server 2003系统的远程计算机上,但是我不知道确切的代码.

注意:我已经尝试使用File.copy方法,但是我失败了,因为远程计算机需要用户名和密码,但是在此方法中没有此类信息.

请帮助我,我不需要MSDN,但是欢迎使用一些确切的代码或其他想法.

--thank you

解决方案

文件和文件夹的WMI任务通过WMI更改文件或文件夹的属性,包括创建共享或重命名文件.如果要复制文件或读写文件,最简单的方法是使用Windows脚本宿主FileSystemObject而不是WMI.有关其他示例,请参阅TechNet ScriptCenter的文件和文件夹"部分.


查看PowerShell.在版本2中,显然具有跨计算机功能.也可以从Powershell进行WMI.


我放弃了WMI,并使用C#中的".net用户"方法来解决该问题.


hi I want to copy my file to a remote machine which system is win server 2003 using WMI, but I don''t know the exact code.

note: I have try to use the method, File.copy, but I am failed, because the remote machine need username and password, but in this method have no such information.

Please help me, and I don''t need the MSDN, but some exact code or other idea all welcome.

--thank you

解决方案

WMI tasks for files and folders change file or folder properties through WMI, including creating a share or renaming a file. If you want to copy a file or read and write a file, the easiest way is to use the Windows Script Host FileSystemObject rather than WMI. For other examples, see the Files and Folders section of the TechNet ScriptCenter.


Look at PowerShell. In verion 2 there is apparently cross computer capabilities. Can also do WMI from Powershell.


I give up WMI, and use the method of ".net user" in C# to solve the problem.


这篇关于如何使用WMI将文件复制到远程计算机(系统是Server 2003)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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