Question Locked

How do you remove all items in the nethood directory?

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to delete everything in the Network Places folder on users XP Professional workstations. Under each users folder is a folder called Nethood, where the connections live.

I am using the quite ordinary script of:
cd %userprofile%\nethood
del *.* /s /q

The results of these commands is that a windows default icon remains that is now a folder holding holding only a desktop.ini file it. All network information is gone. The icon will delete with a right click, but I need it to delete it all with the .bat file I'm running.

I understand the things that reside in the Nethood folder are not ordinary, but sheesh.

Any help is greatly appreciated.

4 replies

by jdclyde

I think that is the service that pulls in that data in the first place? Otherwise XP will just keep putting the entries right back.

by cdgoldin

Your script won't delete folders (which each entry in "Nethood" is), only files within the folders.

To delete folders (directories) that contain files, you must use the deltree command. [Empty folders may be deleted with the RD command.]

Thus you could say:

cd %userprofile%\nethood
deltree *.* /y

or more simply:

deltree "%userprofile%\nethood\*.*" /y

Unfortunately, Windoze will not let you delete these "special" folders from MS-DOS.

This discussion is closed to new replies.