Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Error while deleting files in InetPub

$
0
0

Hi everyone i am using the following code to delete files from inetpub but i am getting the error that some files cannot be deleted because they are being used by another process i am using the following code

if ($confirmation -eq 'y') { get-childitem "C:\inetpub\wwwroot\Russia\Admin" -recurse | % { remove-item $_.FullName -recurse -force } get-childitem "C:\inetpub\wwwroot\Russia\Tab" -recurse | % { if($_.Name -ne 'mediacontent') { remove-item $_.FullName -recurse -force }

}

}

There are no services or anything, they all are dummy folders i am just replicating the production server file structure on to my local machine to get this script working so that we can later use it on production. all i did was copied all the folders from production and paste them in my local intet pub but its not working 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>