I have used a VB script to create a shortcut on everyones desktop. This worked fine and I create a url object. To create my own icon it needed to be changed to an lnk file. Now all the users have the old shortcut as well as the new one with my own icon.
I create a VB script to run at login to delete that file but it works the first time and will create errors afterwards. I can't know for sure when certain users are going to be logging in so I can't put it on there then delete it otherwise it will not work for everybody.
What I need to do is check for this one unique file name on the desktop. If it exists, I want to delete it. If it doesn't I want the script to carry on without popping errors up and people.
I found this on tek-tips:
but this deletes all files with a certain extension and I don't want to delete all url files on everyones desktop. Could anyone tell me or point me to a website that explains how to do this?
Thanks in advance
I create a VB script to run at login to delete that file but it works the first time and will create errors afterwards. I can't know for sure when certain users are going to be logging in so I can't put it on there then delete it otherwise it will not work for everybody.
What I need to do is check for this one unique file name on the desktop. If it exists, I want to delete it. If it doesn't I want the script to carry on without popping errors up and people.
I found this on tek-tips:
Code:
Path1 = "C:\Program Files\HEAT"
Dim fso
Dim oFolder
Dim oFile
Dim oSubFolder
Set fso = createobject("Scripting.FileSystemObject")
Set oFolder = fso.GetFolder(Path1)
For Each oFile In oFolder.files
If Left(oFile.Name,3)= "HFW" And Right(lcase(oFile.Name,3)) = "tmp" Then
oFile.Delete True
End If
Next
but this deletes all files with a certain extension and I don't want to delete all url files on everyones desktop. Could anyone tell me or point me to a website that explains how to do this?
Thanks in advance