Hey everyone this is the very first thing I have ever done with vbs.
My mission was to replace all shortcut files in a folder with their targets then delete the shortcut, I have achieved this but I'm not too sure how well.
Can anyone give me any pointers on my code, I learned everything from the source code of the I love you virus so my code may be really out of date :P Thanks everyone!
main()
sub main()
My mission was to replace all shortcut files in a folder with their targets then delete the shortcut, I have achieved this but I'm not too sure how well.
Can anyone give me any pointers on my code, I learned everything from the source code of the I love you virus so my code may be really out of date :P Thanks everyone!
main()
sub main()
dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("WScript.Shell")
dim DesktopPath
DesktopPath = "C:\Users\User\Desktop\"
dim f,f1,fc,ext
set f = filesys.GetFolder(DesktopPath)
set fc = f.Files
for each f1 in fc
end subset filesys=CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("WScript.Shell")
dim DesktopPath
DesktopPath = "C:\Users\User\Desktop\"
dim f,f1,fc,ext
set f = filesys.GetFolder(DesktopPath)
set fc = f.Files
for each f1 in fc
ext=filesys.GetExtensionName(f1.Path)
if(ext="lnk") Then
nextif(ext="lnk") Then
Set Shortcut = Shell.CreateShortcut(f1.Path)
If filesys.FileExists(Shortcut.TargetPath) Then
end ifIf filesys.FileExists(Shortcut.TargetPath) Then
filesys.CopyFile Shortcut.TargetPath, DesktopPath
filesys.DeleteFile(f1.Path)
end iffilesys.DeleteFile(f1.Path)