Link to home
Start Free TrialLog in
Avatar of SvenIA
SvenIAFlag for Netherlands

asked on

Script to delete files from user profile

Hello,

Network:

Windows Server 2008 R2
Windows 7 Pro x64
Roaming Profiles

Problem:

I've got a user profile that contains files which have a path and filename that are to long to be handled by the operating system. So I can't delete the files. I've got GPO's running that should clean up these files during logoff. Logging off takes very long time, and then i get an error message that the profile could not sync properly. That's because the policy is unable to delete the files.0

Can I delete the files in question somehow? With a powershell script maybe?
Avatar of Sam Simon Nasser
Sam Simon Nasser
Flag of Palestine, State of image

can you explain this:
have a path and filename that are to long to be handled by the operating system

so the user desktop for example is set to c:\users\userX\desktop and not X:\Server\UserX\Desktop
Avatar of SvenIA

ASKER

Sure i can;

User generated image
That folder contains files which have names that are to long. They cannot be deleted.

The policy that is configured to delete these temp files on logoff, cannot delete these files either. That's why profile sync times out when logging off.

The profile is way to large. So I want to cleanup.
SOLUTION
Avatar of Sam Simon Nasser
Sam Simon Nasser
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SvenIA

ASKER

I created a connection directly to the users profile folder. In that way the path is shorter. Then i could delete the files.