yuhs
asked on
What script syntax to delete a file from all of the \\Documents and Settings desktops?
VERY simple script, but I can't figure it out.
I want to deploy a script to my building to delete a particular icon from all the user desktops (XP machines). The icon I want to delete is not in the "All Users" profile, but is saved in individual user profiles. This script below works when I use it to delete the icon from the All Users, Default User, or my own desktop. But how do I script it to delete the icon from all the unknown profiles on the PC ?
This works: del icon.url "\\%PC%\C$\Documents and Settings\all users\Desktop"
This doesn't: del icon.url "\\%PC%\C$\Documents and Settings\%users%\Desktop"
I want to deploy a script to my building to delete a particular icon from all the user desktops (XP machines). The icon I want to delete is not in the "All Users" profile, but is saved in individual user profiles. This script below works when I use it to delete the icon from the All Users, Default User, or my own desktop. But how do I script it to delete the icon from all the unknown profiles on the PC ?
This works: del icon.url "\\%PC%\C$\Documents and Settings\all users\Desktop"
This doesn't: del icon.url "\\%PC%\C$\Documents and Settings\%users%\Desktop"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
^ ... even if icon.url does not exist in the "Documents and Settings" folder, but only it its sub-folders, the command above will delete this file from all the sub-folders.
See here for a good explanation of FOR /F:
http://www.ss64.com/nt/for_cmd.html
Open in new window