I have successfully used the command below in a batch file to get WMIC to delete *.tmp files from the %WINDIR%\TEMP folder on all named workstations on the network running XP. I haven't tested other versions but I assume that, given the age of WMIC, it'll work in later versions of Windows.
WMIC /node:Computer01,Computer02,Computer03 path cim_datafile WHERE "path='%%WINDIR%%\\TEMP\\' AND Extension ='tmp'" delete
Additionally, I would like to delete some Start menu folders (and some shortcuts if possible) on all the computers on the network named in the "node" portion of the command. I'm a little rusty on the WMIC commands; is there a way to specify the path to the All Users' Start menu and delete a subfolder (and its contents) if the folder name matches a string? And is it possible to delete shortcuts if their file name matches a string)?
Ideally, I'd like the following subfolders (and any files contained within them):
C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\
C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Silverlight\
C:\Documents and Settings\All Users\Start Menu\Programs\Sophos\
and the following files:
C:\Documents and Settings\All Users\Start Menu\Programs\Acrobat.com.
C:\Documents and Settings\All Users\Start Menu\Programs\Adobe Reader X.lnk
C:\Documents and Settings\All Users\Start Menu\Programs\HP Help and Support.lnk
...deleted from the Start menu of each named computer on the network.
I'm aware that this is a resource-intensive operation (particularly as there are may other folders I'd like to add to that list), but I plan on running this during network downtime so as not to slow the computers down when in use. My ultimate intention is to clear the clutter of our users' Start menus on the 400+ computers on the network without having to do so manually; I know how to set the node to read from a list in an external text file, as in:
WMIC /failfast:on /node:@"FILENAME.txt"
Many thanks in advance.