How do you remove all items in the nethood directory?

By stevel ·
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.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Sheesh ????? ....

by OldER Mycroft In reply to How do you remove all ite ...
Collapse -

disable the workstation service?

by jdclyde In reply to How do you remove all ite ...

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.

Collapse -

The mystery continues

by cdgoldin In reply to How do you remove all ite ...

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.

Related Discussions

Related Forums