Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
Posted
Comments
[no name] 24-Mar-12 22:47pm    
So you won't do any research but want us to write the code for you?
dirk.zhang 24-Mar-12 23:46pm    
...Definite no, just I have many resource except some precise pseudocode and idea

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.
 
Share this answer
 
Look at PowerShell. In verion 2 there is apparently cross computer capabilities. Can also do WMI from Powershell.
 
Share this answer
 
Comments
dirk.zhang 27-Mar-12 22:45pm    
can you give me more information about PowerShell, I want to learn it more
Clifford Nelson 28-Mar-12 3:56am    
I used it in version 1. You would be surprised at how easy it is to use in place of cmd prompt. There are aliases for the dos commands so you can use them, then they have pipes, and work with objects, so that much more flexible. Can also easily add using C# or VB. PowerShell 2 added cross platform capability, which I have not used. One of the early Powershell books spent a fair amount of time on WMI, but you basically use the same commands as for WMI in DOS prompt. Many of the newer MS tools are actually built on PowerShell, so that you no longer have to do everything through a GUI. Books out there, look at them.
I give up WMI, and use the method of ".net user" in C# to solve the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900