Command to delete temp files

broken image
broken image

When you have a requirement to Copy files on multiple remote machines, then we need to write the script this way. Powershell Script to Delete Files on Remote Computers The Above example removes all files under C:\app\download including subfolders and files recursively as we defined the parameter -Recurse. Remove-Item -Path C:\app\download\* -Force -Recurse The above example removes all the files under C:\temp including hidden ready only files as we declared the parameter -force at the end. The above example removes the raj.txt file in C:\temp drive. It is easy to delete the files on the remote computers using Powershell, there is a command remove-item deletes files, folders, variable, registry keys, and aliases, let’s learn more about this command with examples.Įxamples: Remove-Item -path 'c:\temp\raj.txt' How to Delete Files on Remote Computers, if there is need to delete files on multiple Windows machines then we have to use a script, here in this article we explain how simple code deletes files on remote computers.