1.

Solve : Batch file to remove files in roaming folder for al users (Win 7) ??

Answer»

How to make batch file that removes all files (no folders and no files in folders) in the Roaming Profile for all users ?

This does not work:
del c:\users\*\AppData\Roaming\*.*
del c:\users\%%\AppData\Roaming\*.*
del c:\users\%\AppData\Roaming\*.*

Help ?!PROBABLY because the roaming profile folder is a Win system protected folder and you risk buggering Windows by removing it...
Just curious...why would you WANT to remove it ? ?

I dont want to remove the folder, nor the subfolders in it !

But I want to remove files in the folder !

Thats because lately the UCASH virus adds one or two files in that folder.
And I want to have a tool to remove them easily ...

Well i'm not GOING to be the one to DISCOURAGE you but i will state that a manual method of infection removals is hardly the right way to go about it.In Windows 8 this folder does not have a roaming folder. "c:\Users\All Users\"

And in Windows 7 I see this: no roaming folder either.


C:\Users\All Users>dir /a
Volume in drive C has no label.
Volume Serial Number is FC8D-EAAB

Directory of C:\Users\All Users

07/14/2009 03:53 PM <DIR> .
07/14/2009 03:53 PM <DIR> ..
07/14/2009 03:53 PM <JUNCTION> Application Data [C:\ProgramData]
07/14/2009 03:53 PM <JUNCTION> Desktop [C:\Users\Public\Desktop]
07/14/2009 03:53 PM <JUNCTION> Documents [C:\Users\Public\Documents]
07/14/2009 03:53 PM <JUNCTION> Favorites [C:\Users\Public\Favorites]
01/26/2013 11:04 PM <DIR> Microsoft
07/14/2009 03:53 PM <JUNCTION> Start Menu [C:\ProgramData\Microsoft\Windows\Start Menu]
07/14/2009 03:53 PM <JUNCTION> Templates [C:\ProgramData\Microsoft\Windows\Templates]
0 File(s) 0 bytes

C:\Users\All Users\Application Data>dir /a
Volume in drive C has no label.
Volume Serial Number is FC8D-EAAB

Directory of C:\Users\All Users\Application Data

File Not Found
It's there in both versions...Do you have a DIR output with it in?

My file manager in Windows 8 doesn't show it, and DIR in Windows 7 doesn't show it.

Show hidden files and folders...dir /a does show hidden files and folders.To be clear - there is a roaming folder in other profiles, but not in the All Users profile.


I think now that I misread the first post - he wants all user profiles processed and not the "All users" profile processed. That's going to do a spitload of damage!That was my point...%appdata% is the path to appdata\roaming (at least on windows 7).

Code: [Select]
C:\Users\Lemonilla>cd %appdata%

C:\Users\Lemonilla\AppData\Roaming>


don't know if that helps much, but it might.Until he answers why he wants to do this i think we should hold off on suggestions...as i cannot see any good coming from this exercise ...



Discussion

No Comment Found