delete all files from a client folder with windows 10
-
Hello, is it possible to program a task or a snapin to delete all files from a client folder with windows 10 operating system?
-
@gilberto-ferraz The quick answer is yes. The fog client (which executes the snapins) runs as SYSTEM on the target computer. It has SYSTEM level rights to remove as many files as you want, and even some you may not want.
-
Thanks for the quick response @george1421, but do you know any snapin or reference that has the function of deleting the contents of the transfers folder from the client’s machine ??
-
@gilberto-ferraz I’m not sure I understand about transfer folder.
In general you can create a snapin that runs a batch file. In that batch file you can run the DOS commands to remove the directory.
If you want to remove the directory AND its contents use this command.
rmdir /s /q "D:\Transfer"
If you want to remove just the contents of the Transfer folder then
del /s /q "D:\Transfer\*"
Since you didn’t say where the transfer folder was, I guessed in the commands above.
-
@george1421 Hello again, ok I got it, I must create a Bash file type
echo deleting files
del “C:\Folder*.*” /s /f/q
echo Done!upload this bash to the Fog server in “Snapin Management” and schedule it to run on the client machine I want. and whenever you want
are these the correct steps?
-
@gilberto-ferraz Just two points in your previous post we need to fix.
Batch := MS Windows command script
Bash := Linux shell scriptThere is a difference.
Also on your del command. you are missing a following backslash.
del "C:\Folder\*.*" /s /f/q
One hint too, the double quotes you used must have came from MS Word or similar because they are the double byte version (look closely your double quote marks look different than the ones I used). Use notepad to write your batch script.
The reset is spot on in your post.
-
@george1421 Excellent explanation Thanks for the help. I will close the post as resolved I believe it will work