Deleting Files/Folder shows Successful in KACE but folder still exist
Hello,
I have a script to delete a folder called C:\Program Files\osquery. Inside this folder, there are subfolders and a few files that did not get deleted during the uninstall of the software.
The result of the KACE script showed "Successful" but the folder "osquery" and all its subfolders/files are still there. How can I delete the "osquery" folder? The batch file command is:
@echo off
rmdir "C:\Program Files\osquery" /s /q
I have also tried cmd /c and running rmdir "path" /s /q and KACE returns a successful attempt. But the folder still exist.
Thank you,
Dinah
Answers (2)
Top Answer
rmdir cannot go recursively as you need. rd should do the trick.
Hint: if you want to use the functions as native as possible, run it in a cmd environment like:
Launch “$(KACE_SYS_DIR)\cmd.exe” with params “/c rd c:\windows\temp\* /s /q”
the variable $(KACE_SYS_DIR) is the system directory of the client device. (you can find all variables for scripting if you click on the mario block next to Tasks in scripting and in the admin guide)
Comments:
-
Sometimes it pays to be “oldschool” right Nico ;o) - Hobbsy 1 year ago