I am new to CIM technology and its usability in Powershell. I am trying to copy all txt files from FolderA to FolderB. Both files are located on the root of C.
The script runs successfully with return code 2 with is “Access denied”. I have checked the folder permissions to which full control is granted to administrator. Also I am running PowerShell ISE as admin. Following is my scripting
$query= "SELECT * FROM CIM_LogicalFile WHERE Path= ‘\folderA\’ AND Extension = ‘txt’ "
$obj = Get-WmiObject -ComputerName “localhost” -Query $query
Your help is highly appreciated.