Snapin to delete files on client windows 7
-
Hi all,
I want to delete files creating during a session of client windows 7. It was possible with XP… Is Snapin correct way to do that? If somebody wrote this script I am a client.
Regards -
It was alway possible with xp but was and is not operable on windows vista and higher. With the change and security implementation of UAC with Windows, it has become nearly impossible for the service to interact and/or delete files on the system. This, I suspect, is because services are not allowed to interact with the desktop and as such, they’re not allowed to delete files or directories. Your best bet, I think, would be to create a batch file that removes the files and/or directories you would like removed and push the batch files either as a gpo or logon script.
-
Depending on what you want to delete, there are Group Policy settings built specifically for certain things.
-
Hi all,
Thanks for answers.
I want to delete files uploaded on user desktop, user download directory on client during session. There is only one user with restricted rights and one admin for each pc.
On windows 7 where is group policy settings?
Thanks a lot for help. -
@ccmiens GPMC and GPO only work with AD DS.
-
Windows 7 does have local Group policy settings that you can use without AD. You could also set a log in script that will remove all these files. you could use a simple script that will delete all files on the Desktop and Downloads file, and leave only public desktop icons. The script could be as simple as:
Del %systemdrive%\users\%username%\Downloads\*.* Del %systemdrive%\users\%username%\Desktop\*.*
You would save that as a batch file, like logon.bat. This will remove all files in the users downloads and desktop folders, but will leave public folders as is. You can set this as a log in script in the local Group policy manager, by typing gpedit.msc in the search box in windows 7. and then go to User Configuration>Windows Settings>Scripts(Logon/Logoff), Double click log on and add the script there. You can build this into your images, so that it just works every time. If you ever need to change the script and add more things, simply create a snap in to copy a new file and over write this script and the new script will run.
There are other settings in Group policy that maybe able to accomplish this without scripts but not sure which ones work best for you. I would suggest looking around at it a little and see what is possible.
-
@ITSolutions Hi all,
Thanks a lot for help and for this best software around the world to deploy.
Regards