Hi,
Trying to do something simple ( or so I thought ), but not having much luck with it so far. If I want to delete all shortcuts ( files that have the *.lnk extension ) from a folder called "test", located in the root of my "C: drive" I can do this with a VBScript as follows...
Const DeleteReadOnly = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\test\*.lnk"), DeleteReadOnly
straightforward enough. What I'm trying to accomplish is based on this idea, but more advanced... deleting all of the desktop shortcuts in a user's profile when they log in. So I'm trying to write a VBScript that will be applied, within a GPO as a user "logon script". This VBScript file will look in the user's desktop folder ( in their Windows profile ), and will delete all of the files that are in there.
Unfortunately using %username% as part of the VBScript doesn't work. Hey, it was worth a try!
and obviously I don't want to write a seperate VBScript for all 300 users.
Any suggestions on how to do this would be much appreciated.
thanks in advance to any takers!
Trying to do something simple ( or so I thought ), but not having much luck with it so far. If I want to delete all shortcuts ( files that have the *.lnk extension ) from a folder called "test", located in the root of my "C: drive" I can do this with a VBScript as follows...
Const DeleteReadOnly = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\test\*.lnk"), DeleteReadOnly
straightforward enough. What I'm trying to accomplish is based on this idea, but more advanced... deleting all of the desktop shortcuts in a user's profile when they log in. So I'm trying to write a VBScript that will be applied, within a GPO as a user "logon script". This VBScript file will look in the user's desktop folder ( in their Windows profile ), and will delete all of the files that are in there.
Unfortunately using %username% as part of the VBScript doesn't work. Hey, it was worth a try!
and obviously I don't want to write a seperate VBScript for all 300 users.
Any suggestions on how to do this would be much appreciated.
thanks in advance to any takers!