VMware {code} Community
haroon09
Contributor
Contributor

How to move files from one folder to another folder in datastore

I want to move some files (which aI already got using "HostDatastoreBrowser") from one file system folder to another file system folder (not Managed Object folder).

In VI client we can move files when we are browsing the datastore from one folder to another folder, I want to do the same thing.

Thanks

0 Kudos
4 Replies
lamw
Community Manager
Community Manager

You'll want to use fileManager which has various functions to copy,move,delete,etc. This is also implemented in Perl script called vifs which is part of the vSphere SDK for Perl and vCLI. You can download vCLI and take a look at the Perl script to get an idea how to implement this.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

Twitter: @lamw

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
admin
Immortal
Immortal

You can move files and folders between datastores using MoveDatastoreFile_Task API.

You might want to refer to similar forum thread which answers how to use MoveDatastoreFile_Task API in vCLI:

http://communities.vmware.com/thread/207880

0 Kudos
haroon09
Contributor
Contributor

Thansk for your replies.

I am using vim2.0 and MoveDatastoreFIle_Task is not avialable in it.

I will try to use FIleManager.

0 Kudos
haroon09
Contributor
Contributor

oh, FIleManager is also defined in vim 2.5, do you guys know how can I accomplish this task using vim 2.0 API's?

0 Kudos